09 2022 档案
摘要:from pynput import keyboard # 按下后执行 def on_press(key): try: if key == keyboard.KeyCode.from_char('enter'): pass elif key == keyboard.Key.left: print("
阅读全文
摘要:def window_capture_beat(hwnd,stayx:int,endx:int,stay:int,endy:int): hwndDC = win32gui.GetWindowDC(hwnd) mfcDC = win32ui.CreateDCFromHandle(hwndDC) sav
阅读全文
摘要:import time import pyautogui def rgb2hex(r, g, b): return '#{:02x}{:02x}{:02x}'.format(r, g, b) try: width, height = pyautogui.size() while True: time
阅读全文
摘要:#实时获取当前活动窗口的句柄及标题并输出至控制台 import win32gui while True: time.sleep(1) now_hwnd = win32gui.GetForegroundWindow() now_hwnd_title = win32gui.GetWindowText(n
阅读全文
摘要:图片来源:https://blog.csdn.net/caohongxing/article/details/120407381 实用实例: 1、截取图片 img = cv2.imread("img_path") img = img[y1:y2, x1:x2] 2、检查某个像素点的RGB img =
阅读全文
摘要:import time import win32api import win32con import win32gui class Virtual_Keyboard(object): def __init__(self, hwnd): self.hwnd = hwnd self.hwnd_title
阅读全文
摘要:1 #对后台窗口截图 2 import win32gui, win32ui, win32con 3 import cv2 4 import numpy as np 5 6 #获取后台窗口的句柄,注意后台窗口不能最小化 7 hWnd = win32gui.FindWindow("NotePad",No
阅读全文

浙公网安备 33010602011771号