CD - Canvas Draw

Clipboard Driver (cdclipbd.h)

This driver allows the access to a Clipboard area. It is greatly dependent on the system. In Win32s, it creates a Windows Metafile; in Windows 95 or Windows NT, it creates an Enhanced Metafile; in Macintosh it creates a PICT; in X-Windows it creates a CD Metafile.


Use

The canvas is created by means of a call to function cdCreateCanvas(CD_CLIPBOARD, Data), after which other functions in the CD library can be called as usual. The Data parameter string is platform-dependent and varies according to the metafile created. See each metafile's documentation, but remember to exclude parameter "filename"

In the Windows environment, if the string "-b" is present, it means that a bitmap must be created instead of a metafile, and, if the string "-m" is specified, a CD Metafile will be created. Note: for reasons unknown to us, in Word for Windows 7.0 (Office 95), images pasted from the Clipboard lose their aspect ratio and look squared.

In the X-Windows environment, the Display ("%p") where the data will be stored must be passed as a parameter before the CD Metafile parameters. This environment's driver is used only for applications that use CD to communicate with each other, because a CD Metafile is created.

Any amount of such canvases may exist simultaneously. It is important to note that a call to function cdKillCanvas is required to properly copy the data to the Clipboard.

You can interpret the data from the Clipboard using function cdPlay. In the X-Windows environment, the parameter "data" for the cdPlay function is the pointer to the Display where the metafile will be obtained.


Behavior of Functions

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

A metafile created in Win32s has the same limitations as the WMF driver. In Windows 95 or NT, it has the same limitations as the EMF driver.