-
Jun 12th, 2025, 08:39 PM
#1
Thread Starter
PowerPoster
how to show emf+ by vb6?check emf/emf+ format?
how to show emf+ by vb6?check emf/emf+ format?
how to create emf+ by vb6?
[RESOLVED] [GDI+] EMF > WMF & VB6 LoadPicture-VBForums
https://www.vbforums.com/showthread....B6-LoadPicture
PNG transparency weird: GDI+ Draw into Meta DC-VBForums
https://www.vbforums.com/showthread....ypeEmfPlusDual
SHOW BY -mspaint.exe-AND VB6 GDI32 PlayEnhMetaFile
Last edited by xiaoyao; Jun 12th, 2025 at 09:30 PM.
-
Jun 12th, 2025, 09:32 PM
#2
Thread Starter
PowerPoster
Re: how to show emf+ by vb6?check emf/emf+ format?
Code:
'EMFs can be moved between various formats. GDI+ prefers "EMF+", which supports GDI primitives as well as newer GDI+ commands
Private Enum MetafileType
MetafileTypeInvalid 'Invalid metafile
MetafileTypeWmf 'Standard WMF
MetafileTypeWmfPlaceable 'Placeable WMF
MetafileTypeEmf 'Plain EMF (not EMF+)
MetafileTypeEmfPlusOnly 'EMF+ without dual down-level records
MetafileTypeEmfPlusDual 'EMF+ with dual down-level records
End Enum
Private Enum EMFType
EmfTypeEmfOnly = MetafileTypeEmf 'Only the old GDI EMF format
EmfTypeEmfPlusOnly = MetafileTypeEmfPlusOnly 'Only the new GDI+ EMF+ format
EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual 'Store duplicate commands, in both EMF and EMF+ format
End Enum
Private Declare Function GdipConvertToEmfPlus Lib "gdiplus" (ByVal refGraphics As Long, ByVal oldMetafilePtr As Long, ByRef conversionSuccess As Long, ByVal typeOfEMF As EMFType, ByVal descriptionPointer As Long, ByRef newMetafilePtr As Long) As Long
A couple notes...
-
Jun 12th, 2025, 09:36 PM
#3
Thread Starter
PowerPoster
Re: how to show emf+ by vb6?check emf/emf+ format?
 Originally Posted by Jonney
Rather using old GDI EMF, why not use GDI+ GdipRecordMetafile? I will consider this technique.
Code:
Dim rctF As RECTF, metafile As Long,hGraphics As Long,Meta_DC As Long
rctF.Width = paperWidthInMillimeter: rctF.Height = paperHeightInMillimeter
Dim lR As Long
lR = GdipRecordMetafile(Printer.hdc, EmfTypeEmfPlusOnly, rctF, MetafileFrameUnitMillimeter, StrPtr("EMFPlus"), metafile) 'or hdc = CreateCompatibleDC(0)
If lR= 0 Then
GdipGetImageGraphicsContext metafile, hGraphics
GdipGetDC hGraphics, Meta_DC
End If
Edited:
I draw something on the Meta_DC, seemed nothing showing. Don't know why.
GdipGetHemfFromMetafile metafile,hEmf also doesn't work.
OK, I will open another new thread regarding GdipRecordMetafile. But if you like to post something below,go ahead. I will keep follow-up. Thanks.
 Originally Posted by DrUnicode
how to create emf+ file?
-
Jun 13th, 2025, 07:25 AM
#4
Thread Starter
PowerPoster
Re: how to show emf+ by vb6?check emf/emf+ format?
[RESOLVED] How to make GdipRecordMetafile sets of API work?-VBForums
https://www.vbforums.com/showthread....RecordMetafile
This can create an EMF+file, but it requires specifying a new EMF file path from the beginning, then drawing, and finally displaying it on picture1.hdc.
GdipDeleteGraphics hMetaGraphics
It is impossible to update and display the image in real-time every time it is drawn.
Like rectangles, circles, and triangles, they are displayed once every time.
It would be even better to not specify a file name at the beginning and save it in EMF+format after drawing.
Last edited by xiaoyao; Jun 13th, 2025 at 08:38 AM.
-
Jun 16th, 2025, 03:30 PM
#5
Fanatic Member
Re: how to show emf+ by vb6?check emf/emf+ format?
Last edited by yokesee; Jun 16th, 2025 at 04:01 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|