From 4d9dcd03a014528b0d22411ba42ef7116af1d568 Mon Sep 17 00:00:00 2001 From: loser <1711788888@qq.com> Date: Fri, 17 Jun 2022 22:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'w2p.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wmf转png demo --- w2p.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 w2p.py diff --git a/w2p.py b/w2p.py new file mode 100644 index 0000000..64a1c20 --- /dev/null +++ b/w2p.py @@ -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) \ No newline at end of file