refactor: 移除不再使用的配置文件与代码,优化用户界面
- 删除 config.json 和 requirements.txt 文件,移除 Python 版相关代码,简化项目结构。 - 更新 README.md,调整工具说明,强调仅保留 C# WinForms 版本。 - 在 MainForm.cs 中添加输入框的占位提示,提升用户体验。 - 更新 .gitignore,添加 debug.log 文件以记录运行时日志。 - 移除与 Python 版相关的示例 CSV 文件,确保数据源一致性。
This commit is contained in:
@@ -146,6 +146,22 @@ def crop_zoom(src_png_w, src_png_h, rgba, cw, ch, scale, path, ox=0, oy=0):
|
||||
|
||||
|
||||
def main():
|
||||
# 必须声明 DPI 感知:否则 GetWindowRect 返回的是被系统虚拟化(/缩放比)的坐标,
|
||||
# 抓出来的图只有窗口左上角一块,高 DPI 下右/下必被裁掉。
|
||||
# Win10 起用 shcore 的 per-monitor 感知最可靠,老系统退回 user32.SetProcessDPIAware。
|
||||
aware = False
|
||||
try:
|
||||
ctypes.windll.shcore.SetProcessDpiAwareness(2) # PROCESS_PER_MONITOR_DPI_AWARE
|
||||
aware = True
|
||||
except Exception:
|
||||
pass
|
||||
if not aware:
|
||||
try:
|
||||
aware = bool(u32.SetProcessDPIAware())
|
||||
except Exception:
|
||||
pass
|
||||
print("dpi aware:", aware)
|
||||
|
||||
exe = sys.argv[1]
|
||||
out = sys.argv[2]
|
||||
icon_dump = sys.argv[3] if len(sys.argv) > 3 else None
|
||||
|
||||
Reference in New Issue
Block a user