Contents Up Previous Next

GDI functions

The following are relevant to the GDI (Graphics Device Interface).

Include files

<wx/gdicmn.h>

::wxColourDisplay
::wxDisplayDepth
::wxMakeMetafilePlaceable
::wxSetCursor


::wxColourDisplay

bool wxColourDisplay()

Returns TRUE if the display is colour, FALSE otherwise.


::wxDisplayDepth

int wxDisplayDepth()

Returns the depth of the display (a value of 1 denotes a monochrome display).


::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 wxWindows 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.


::wxSetCursor

void wxSetCursor(wxCursor *cursor)

Globally sets the cursor; only has an effect in Windows and GTK. See also wxCursor, wxWindow::SetCursor.