我正在使用枕头图像生成图标。之后,我使用pyinstaller生成可执行文件。当我将可执行文件固定到任务栏时,图像看起来不清晰。
def drawicon(text, imagesize, fontsize1, fontsize2, indent, iconfile):
#build the icon
img = Image.new('RGBA', (imagesize, imagesize), color='white')
draw = ImageDraw.Draw(img)
# font = ImageFont.truetype(<font-file>, <font-size>)
font = ImageFont.truetype("../fonts/calibri/CALIBRIB.ttf", fontsize1)
draw.text((indent,0),'DEX',(255,0,0),font=font)
font = ImageFont.truetype("../fonts/calibri/CALIBRIB.ttf", fontsize2)
draw.text((indent,130),text,(0,0,0),font=font)
img.save(iconfile, 'ICO', sizes = [(16, 16), (24, 24), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)])
我在做什么错了?