Version: 3.0.5
Loading...
Searching...
No Matches
metafile.h File Reference

Classes

class  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. More...
 
class  wxMetafile
 A wxMetafile represents the MS Windows metafile object, so metafile operations have no effect in X. More...
 

Functions

bool wxMakeMetafilePlaceable (const wxString &filename, int minX, int minY, int maxX, int maxY, float scale=1.0)
 Given a filename for an existing, valid metafile (as constructed using wxMetafileDC) makes it into a placeable metafile by prepending a header containing the given bounding box.
 

Function Documentation

◆ wxMakeMetafilePlaceable()

bool wxMakeMetafilePlaceable ( const wxString filename,
int  minX,
int  minY,
int  maxX,
int  maxY,
float  scale = 1.0 
)

Given a filename for an existing, valid metafile (as constructed using wxMetafileDC) makes it into a placeable metafile by prepending a header containing the given bounding box.

The bounding box may be obtained from a device context after drawing into it, using the functions wxDC::MinX(), wxDC::MinY(), wxDC::MaxX() and wxDC::MaxY().

In addition to adding the placeable metafile header, this function adds the equivalent of the following code to the start of the metafile data:

SetMapMode(dc, MM_ANISOTROPIC);
SetWindowOrg(dc, minX, minY);
SetWindowExt(dc, maxX - minX, maxY - minY);

This simulates the wxMM_TEXT mapping mode, which wxWidgets assumes.

Placeable metafiles may be imported by many Windows applications, and can be used in RTF (Rich Text Format) files.

scale allows the specification of scale for the metafile.

This function is only available under Windows.

Include file:

#include <wx/metafile.h>