22 lines
440 B
Python
22 lines
440 B
Python
import pinPicture
|
||
from PIL import Image
|
||
import tkinter as tk
|
||
|
||
import pyautogui
|
||
import keyboard
|
||
|
||
|
||
def capture_screen():
|
||
screenshot = pyautogui.screenshot()
|
||
root = tk.Tk()
|
||
image = screenshot.convert('RGBA')
|
||
pin = pinPicture.PinPicture(image, root)
|
||
root.mainloop()
|
||
|
||
|
||
|
||
# 监听特定快捷键,这里假设是Ctrl+Alt+S
|
||
keyboard.add_hotkey('F7', capture_screen)
|
||
|
||
# 保持程序运行,持续监听快捷键
|
||
keyboard.wait() |