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.
It is recomended to use EMF instead of WMF whenever is possible.
Use
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.
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.
ControlĀ
- Play: different from the basic driver, is implemented.
- Clear: different from the basic driver, does nothing.
Coordinate System and Clipping
- Clip: does nothing, returns CD_CLIPOFF.
Attributes
- Stipple: is always opaque and smaller than 8x8 pixels.
- Pattern: does nothing.
- LineWidth: is always 1.
- TextAlignment: CD_CENTER/CD_WEST/CD_EAST is saved as CD_BASE_CENTER/CD_BASE_LEFT/CD_BASE_RIGHT, but the position error is compensated.
- TextOrientation: does nothing
Client ImagesĀ
- GetImageRGB: does nothing.
- PutImageRGBA: the alpha component is ignored.
Server Images
- All functions do nothing.