contents up previous next

wxmetafiledc

this is a type of device context that allows a metafile object to be created (windows only), and has most of the characteristics of a normal wxdc. the wxmetafiledc::close member must be called after drawing into the device context, to return a metafile. the only purpose for this at present is to allow the metafile to be copied to the clipboard (see wxmetafile).

adding metafile capability to an application should be easy if you already write to a wxdc; simply pass the wxmetafiledc to your drawing function instead. you may wish to conditionally compile this code so it is not compiled under x (although no harm will result if you leave it in).

note that a metafile saved to disk is in standard windows metafile format, and cannot be imported into most applications. to make it importable, call the function ::wxmakemetafileplaceable after closing your disk-based metafile device context.

derived from

wxdc
wxobject

include files

<wx/metafile.h>

see also

wxmetafile, wxdc

members

wxmetafiledc::wxmetafiledc
wxmetafiledc::~wxmetafiledc
wxmetafiledc::close


wxmetafiledc::wxmetafiledc

wxmetafiledc(const wxstring& filename = "")

constructor. if no filename is passed, the metafile is created in memory.


wxmetafiledc::~wxmetafiledc

~wxmetafiledc()

destructor.


wxmetafiledc::close

wxmetafile * close()

this must be called after the device context is finished with. a metafile is returned, and ownership of it passes to the calling application (so it should be destroyed explicitly).