SOS Win - How to save metafile as Bitmap ?

F

fowlertrainer

Hi !

My problem is that: I have a program that copy pictures from Notes NSF file.
The format is METAFILE or METAFILEPICT.

I can save these pictures with this code:

import win32api
import win32con
import win32gui
....
mode=0
if mode==0:
import win32clipboard, win32con
win32clipboard.OpenClipboard()
try:
if
win32clipboard.IsClipboardFormatAvailable(win32con.CF_ENHMETAFILE):
print "METAFILE"
hdl=win32clipboard.GetClipboardData(win32con.CF_ENHMETAFILE)
f=open('c:\\test.emf','wb')
f.write(hdl)
f.close()
finally:
win32clipboard.CloseClipboard()
....

But I need to convert them to BMP files.
I have wxPython, and PIL, and win32api ext.

wxPython have wxMetaFile class, but I cannot found it's import path.
import ????
PIL have clipboard tool, but it is make wrong palette for these copies.

So what is the better, "simplier" (have the english a word like this ?)
solution to my problem ?

Thanx for the quick help:
ft

PS:
Do not use outer program for convert it. I have it same program, but I
want to do it in python !!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top