470,619 Members | 1,659 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

Metafile issue

Hi there,

I am obtaining a meta file from the clipboard via the following code
Dim CF_ENHMETAFILE As Integer = 14
Dim cMFeImage As Imaging.Metafile

Dim pIPrClipboard As IntPtr = OpenClipboard(Me.Handle)

If (IsClipboardFormatAvailable(CF_ENHMETAFILE)) Then
Dim pIPrData As IntPtr = GetClipboardData(CF_ENHMETAFILE)
cMFeImage = New Imaging.Metafile(pIPrData, False)
Call cMFeImage.Save("c:\pop.emf", Imaging.ImageFormat.emf)
End If

Call CloseClipboard()
If I display the image in a picture box and redraw it during resize it
looks great, definitely an EMF, but the saved image "pop.emf" is not an
EMF, more like a JPEG, it's been rasterised somewhere along the lines and
now looks awful.

Any ideas what's happening?

If you open a spreadsheet in excel and copy a chart to the clipboard you
can use that. Again, looks great in VB, but not when saved.

BTW, I have tried seeing the 2nd property of the MetaFile constructor to
True / False, same thing happens.

Many thanks in advance.

Nick.
Dec 19 '06 #1
2 1610
It's okay, this problem was resolved.

"NickP" <ni**@nick.comwrote in message
news:OE**************@TK2MSFTNGP03.phx.gbl...
Hi there,

I am obtaining a meta file from the clipboard via the following code
Dim CF_ENHMETAFILE As Integer = 14
Dim cMFeImage As Imaging.Metafile

Dim pIPrClipboard As IntPtr = OpenClipboard(Me.Handle)

If (IsClipboardFormatAvailable(CF_ENHMETAFILE)) Then
Dim pIPrData As IntPtr = GetClipboardData(CF_ENHMETAFILE)
cMFeImage = New Imaging.Metafile(pIPrData, False)
Call cMFeImage.Save("c:\pop.emf", Imaging.ImageFormat.emf)
End If

Call CloseClipboard()
If I display the image in a picture box and redraw it during resize it
looks great, definitely an EMF, but the saved image "pop.emf" is not an
EMF, more like a JPEG, it's been rasterised somewhere along the lines and
now looks awful.

Any ideas what's happening?

If you open a spreadsheet in excel and copy a chart to the clipboard
you can use that. Again, looks great in VB, but not when saved.

BTW, I have tried seeing the 2nd property of the MetaFile constructor
to True / False, same thing happens.

Many thanks in advance.

Nick.

Dec 21 '06 #2
"NickP" <ni**@nick.comwrote:
>If I display the image in a picture box and redraw it during resize it
looks great, definitely an EMF, but the saved image "pop.emf" is not an
EMF, more like a JPEG, it's been rasterised somewhere along the lines and
now looks awful.
It's okay, this problem was resolved.
Could you say how the problem was resolved, please? I'm curious.

--
Lucian
Dec 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Julian Ziersch | last post: by
1 post views Thread by sendhil | last post: by
3 posts views Thread by Richard Skopal | last post: by
2 posts views Thread by George Yefchak | last post: by
reply views Thread by weiruic | last post: by
5 posts views Thread by Peter | last post: by
2 posts views Thread by Laurent Navarro | last post: by
1 post views Thread by bern11 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.