CD - Canvas Draw

CD_WMF - Windows Metafile Driver (cdwmf.h)

This driver allows creating a Microsoft Windows Metafile, the format used by 16-bit Windows systems to store graphics primitives. Usually, the filename has an extension "*.wmf".

The driver works only in the Microsoft Windows platform, but you can use it in other platforms without the risk of compilation error. If you attempt to create a canvas in another platform, function cdCreateCanvas will return NULL.


The canvas is created by means of a call to the function cdCreateCanvas(CD_WMF, Data), after which other functions in the CD library can be called as usual. The Data parameter string has the following format:

"filename widthxheight [resolution]" or in C "%s %dx%d %g"

The file's name and dimensions are required. Width and height are provided in pixels (note the lowercase "x" between them). Resolution is the number of pixels per millimeter; its default value is the screen resolution.

Any amount of such canvases may exist simultaneously. Function cdCreateCanvas creates a memory-based metafile, and a call to function cdKillCanvas is required to close the file properly.

In fact the driver uses a slightly different format, called Aldus Placeable Metafile (APM). It attaches a small header to the beginning of the file, allowing other applications to import better the metafile contents.

It is recomended to use EMFs instead of WMF whenever is possible. This driver is NOT available for the GDI+ base driver.

Behavior of Functions

This driver is greatly platform-dependent. For further detail, see the Behavior of Functions of the Microsoft Windows (GDI) platform. However, it should be noted that some functions behave differently from the basic functions of each platform.


  • cdPlay: different from the basic driver, is implemented.
  • cdClear: different from the basic driver, does nothing.

Coordinate System and Clipping


Client ImagesĀ 

Server Images

  • All functions do nothing.