添加 'w2p.py'

wmf转png demo
This commit is contained in:
loser 2022-06-17 22:41:08 +08:00
parent d2fe9d0884
commit 4d9dcd03a0

11
w2p.py Normal file
View File

@ -0,0 +1,11 @@
from PIL import Image
import os
mapfile = "C:\\Users\\Administrator\\Desktop\\1.wmf"
im = Image.open(mapfile)
path = str(os.path.dirname(mapfile))
onlyfilename, ext = os.path.splitext(os.path.basename(mapfile))
str_onlyfilename = str(onlyfilename)
im.save(path + '\\'+ str_onlyfilename + '.png', quality=95)