Page 1 of 1
Posted: Mon Oct 07, 2002 7:43 pm
by BackupUser
Restored from previous forum. Originally posted by TerryHough.
Does anyone know how to use PB to display either the Enhanced Metafile Format or Windows Metafile Format file?
Could this be displayed similarly to the .BMP images in an ImageGadget? Or even to the windows background?
Thanks
Terry
Posted: Tue Oct 08, 2002 7:37 am
by BackupUser
Restored from previous forum. Originally posted by SoulTaker.
CloseEnhMetaFile Closes an enhanced-metafile device context.
CopyEnhMetaFile Copies the contents of an enhanced-format metafile to a specified file.
CreateEnhMetaFile Creates a device context for an enhanced-format metafile.
DeleteEnhMetaFile Deletes an enhanced-format metafile or an enhanced-format metafile handle.
EnhMetaFileProc An application-defined callback function used with the EnumEnhMetaFile function.
EnumEnhMetaFile Enumerates the records within an enhanced-format metafile.
GdiComment Copies a comment from a buffer into a specified enhanced-format metafile.
GetEnhMetaFile Creates a handle that identifies the enhanced-format metafile stored in the specified file.
GetEnhMetaFileBits Retrieves the contents of the specified enhanced-format metafile and copies them into a buffer.
GetEnhMetaFileDescription Retrieves an optional text description from an enhanced-format metafile and copies the string to the specified buffer.
GetEnhMetaFileHeader Retrieves the record containing the header for the specified enhanced-format metafile.
GetEnhMetaFilePaletteEntries Retrieves optional palette entries from the specified enhanced metafile.
GetWinMetaFileBits Converts the enhanced-format records from a metafile into Windows-format records.
PlayEnhMetaFile Displays the picture stored in the specified enhanced-format metafile.
PlayEnhMetaFileRecord Plays an enhanced-metafile record by executing the graphics device interface (GDI) functions identified by the record.
SetEnhMetaFileBits Creates a memory-based enhanced-format metafile from the specified data.
SetWinMetaFileBits Converts a metafile from the older Windows format to the new enhanced format.
I haven;t played with this but that should lead you to the right direction.
You will need the Windows API Reference.
Abit BD7-II Raid P4 1.9 gHz 384 Ram Xtasy GFroce 3 TI 200 CD-RW DirectX 9.0 Beta 2 Sound Blaster Live! XP Pro, Registered PureBasic version 3.30 For Windows.
Posted: Thu Oct 10, 2002 9:26 pm
by BackupUser
Restored from previous forum. Originally posted by TerryHough.
Thanks for the pointers. Unfortunately, I'm not that good with API yet. I will see what I can do.
Posted: Fri Oct 11, 2002 7:05 pm
by BackupUser
Restored from previous forum. Originally posted by TerryHough.
So now I am totally lost!
Does anyone have a PB example of displaying a .EMF file? It sure would be a big help.
Thanks
Terry
Posted: Fri Oct 11, 2002 8:07 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.
Here is a quick little PB code I translated straight from Platform SDK...
Maybe it will get you started (it displays a EMF file called "test.emf")
Code: Select all
hWnd=OpenWindow(0,0,0,400,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"EMF Viewer")
hEmf=GetEnhMetaFile_("test.emf")
hDC = GetDC_(hWnd)
GetClientRect_(hWnd,rec.RECT)
PlayEnhMetaFile_(hDC,hEmf,rec)
Repeat
Until WaitWindowEvent()=#PB_EventCloseWindow
DeleteEnhMetaFile_(hEmf)
ReleaseDC_(hWnd, hDC)
----------
Visit the PB Resources Site at
http://www.reelmediaproductions.com/pb
Posted: Mon Oct 14, 2002 2:55 pm
by BackupUser
Restored from previous forum. Originally posted by TerryHough.
Thanks Paul. Maybe that will turn my lights on!