473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SOS Win - How to save metafile as Bitmap ?

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_EN HMETAFILE)
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 !!!
Jul 18 '05 #1
0 1681

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kirk Quinbar | last post by:
hi, I have the following sample .NET 1.0 code which converts a metafile to a bitmap: Dim tmpImage As Bitmap 'System.Drawing.Image Dim streamX As New System.IO.MemoryStream() Dim fs As...
6
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e)...
9
by: Mark Johnson | last post by:
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file. I can read in the Images to the Grafics, but when I try this...
0
by: gana | last post by:
I'm converting an EMF to BMP. Image is coming properly except that background color of the bMP is set to black. I'm saving EMF to a stream and craeting BMP from stream. One more thing I tried is...
2
by: George Yefchak | last post by:
Hi I need to retrieve a metafile image from the clipboard and render it as a bitmap in my application. In particular, an image will be placed on the clipboard by pasting from PowerPoint (I...
5
by: Peter | last post by:
Does anyone have a c# or vb.net example of how to convert bitmap to Metafile - preferably without writing anything to a file ? Thank You Peter
1
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but...
0
by: =?Utf-8?B?U3lsdmFpbiBBcmVuZQ==?= | last post by:
Hi, I would like to serialize a class which includes an image property field. I have no problem saving with bitmap image. However, when using a metafile (*.emf format) the result is also...
13
by: Joe | last post by:
does anyone know why this source code throws an error?? Dim myBitmap As System.Drawing.Bitmap Dim myGraphics As Graphics myBitmap = New System.Drawing.Bitmap(fileName:="C:\test.tif")...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.