Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>createmetafile()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CreateMetaFile()
Create a metafile device context
------------------------------------------------------------------------------

Syntax
CreateMetaFile( [ <cFile> ] )   -->   hDCMeta

Arguments
<cFile> is the name of the metafile to create.  It should be a
valid file name.  If <cFile> is nil, a memory metafile is
created.

Returns
If successful, a handle to the new metafile device context is
returned (a non-zero numeric).  Otherwise, zero is returned.

Description
This function creates a metafile device context on disk or in
memory and makes it available for recording sequences of GDI
function calls.

After recording to the created metafile device context, you
should call the CloseMetaFile() function to close the
metafile device context for recording and obtain a metafile
handle.  You should eventually release this handle by calling
the DeleteMetaFile() function.

Example
hDCMeta = CreateMetaFile( 0 )    // get a device context to record a metafile
MoveTo( hDCMeta, 50, 50 )
LineTo( hDCMeta, 150, 50 )         // draw a line
hMetaFile = CloseMetaFile( hDCMeta ) // close hDCMeta and convert to a
                                  // metafile handle
hDC = GetDC( hWnd )                // get device context of window hWnd
PlayMetaFile( hDC, hMetaFile )     // play the metafile

ReleaseDC( hWnd, hDC )             // free the device context
DeleteMetaFile( hMetaFile )

See Also: CloseMetaFile() DeleteMetaFile() PlayMetaFile()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson