好的,是一个思路,有空我去tb看看,只不过现在没有置换键盘的需求
突然有个新的思路:因为用电脑的时候,眼睛一般都是跟着鼠标光标的(除了打字的时候),所以可以自己做一个圆环变大变小的动图,转换成 *.cur 文件,设置为鼠标指针
Windows XP 自带的鼠标指针主题里就有一个这样的,指针本来是白色,然后会逐渐被蓝色填充,蓝色填满后又会逐渐褪去。
将图片截成长条gif, 放在屏幕顶部, 根据情况放大图片, 效果好像还可以啊
update 2024/07/04 21:49:23:
下面图片显示的是用ahk脚本调整窗口透明度 及python脚本写的无边框动态gui(鼠标中键点击关闭)
ahk脚本调整透明度:
#NoEnv
transparency := 255
^+WheelUp::
transparency -= 5
if (transparency < 100)
transparency := 100
ToolTip %transparency%
SetTimer, ResetToolTip, 1000
WinSet, Transparent, %transparency%, A
return
^+WheelDown::
transparency += 5
if (transparency > 255)
transparency := 255
ToolTip %transparency%
SetTimer, ResetToolTip, 1000
WinSet, Transparent, %transparency%, A
return
ResetToolTip:
ToolTip
return
python脚本显示动态无边框gui
import tkinter as tk
import ctypes
if ctypes.windll.kernel32.GetConsoleWindow() != 0:
ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 0)
def drag_window(event):
# 记录鼠标按下时的窗口位置
root.x = root.winfo_x()
root.y = root.winfo_y()
# 记录鼠标按下时的光标位置
root.xmouse = event.x_root
root.ymouse = event.y_root
def move_window(event):
# 计算窗口应该移动到的位置
x = root.x + event.x_root - root.xmouse
y = root.y + event.y_root - root.ymouse
# 移动窗口
root.geometry(f"+{x}+{y}")
def close_window(event):
# 当鼠标中键点击时,关闭窗口
root.destroy()
root = tk.Tk()
# root.title("动态GUI")
root.overrideredirect(True)
# canvas = tk.Canvas(root, width=1600, height=200, bg='#E0E7F7')
# canvas.pack()
# 绑定鼠标按下事件以记录初始位置
root.bind("<ButtonPress-1>", drag_window)
# 绑定鼠标移动事件以移动窗口
root.bind("<B1-Motion>", move_window)
# 绑定鼠标中键点击事件以关闭窗口
root.bind("<Button-2>", close_window)
# 禁用窗口的自动调整大小
root.resizable(False, False)
canvas = tk.Canvas(root, width=1600, height=900, bg='#E0E7F7')
canvas.pack(fill='both', expand=True)
green_color = '#FF4F00'
# x 设置为画布宽度的一半
x = 1600 // 2
width = 1600
height = 900
fill_width = 0 # 填充的宽度
direction = 'expand' # 'expand' 或 'contract'
elapsed_time = 0 # 已经过去的时间
# 持续时间变量,用于动态改变
expand_duration = 1.5 # 扩散的总时间(秒)
contract_duration = 2 # 收缩的总时间(秒)
current_duration = expand_duration # 当前阶段的持续时间
ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 0)
def update_gui():
global fill_width, direction, elapsed_time, current_duration
# 更新已过去的时间
elapsed_time += 0.01 # 每10毫秒调用一次update_gui
# 持续时间变量,用于动态改变
expand_duration = 2 # 扩散的总时间(秒)
contract_duration = 4 # 收缩的总时间(秒)
current_duration = expand_duration # 当前阶段的持续时间
def update_gui():
global fill_width, direction, elapsed_time, current_duration
# 更新已过去的时间
elapsed_time += 0.01 # 每10毫秒调用一次update_gui
# 计算填充宽度
if direction == 'expand':
fill_width = int(elapsed_time / current_duration * (width // 2))
if fill_width >= width // 2:
direction = 'contract'
elapsed_time = 0 # 重置时间计数器
current_duration = contract_duration # 切换到收缩的持续时间
else:
fill_width = int(max(0, (1 - elapsed_time / current_duration) * (width // 2)))
if fill_width <= 0:
direction = 'expand'
elapsed_time = 0 # 重置时间计数器
current_duration = expand_duration # 切换到扩散的持续时间
# 清除画布
canvas.delete('all')
# 在中间开始,向两边绘制矩形
canvas.create_rectangle(x - fill_width, 0, x + fill_width, height, fill=green_color)
# 在10毫秒后再次调用update_gui
root.after(10, update_gui)
update_gui()
root.mainloop()
等一下,patch先生,之前那个是样本…
VBM
密码:a0v6
下载压缩包,打开里面那个!start.bat即可
播放器的窗口可缩放,缩放之后再点击一次启动按钮即可适配
将此工程正式赋名为VBM,采用了PECMD和ffmpeg
嵌入了MP4视频播放器,较动图减少了CPU占用
这个更好了,谢谢3老师!看着比原来更顺滑了,设置界面也直观