feat: v0.1.0更新
This commit is contained in:
16
resources/convert_to_ico.py
Normal file
16
resources/convert_to_ico.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
"""将PNG图标转换为ICO格式"""
|
||||
|
||||
from PIL import Image
|
||||
import os
|
||||
|
||||
def png_to_ico(png_path, ico_path):
|
||||
"""将PNG转换为ICO"""
|
||||
img = Image.open(png_path)
|
||||
# ICO文件支持多种尺寸,Windows会根据需要选择合适的尺寸
|
||||
img.save(ico_path, format='ICO', sizes=[(16, 16), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)])
|
||||
print(f"Created: {ico_path}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
png_to_ico("icons/app_icon.png", "app_icon.ico")
|
||||
print("\nICO file generated successfully!")
|
||||
Reference in New Issue
Block a user