## CD_IUPDRAW - IupDraw Driver (iupdraw_cd.h)

This CD driver allows to draw onto an IUP canvas using the CD API but internally uses the IupDraw API.

### Use

The canvas is created by means of a call to the function cdCreateCanvas(CD_IUPDRAW, Data), after which other CD functions can be called as usual. This function creates a CD canvas based on the existing IUP canvas. The parameter Data is a pointer to a handle of the IUP canvas (Ihandle*). For use with CDLUA, a canvas created with IUPLUA must necessarily be passed as parameter.

Any amount of such canvases may exist simultaneously, but they should not use the same IUP canvas. It is important to note that a call to function cdKillCanvas is required to close the file properly.

The CD canvas is automatically stored in the IUP canvas as the "_CD_CANVAS" attribute.

The driver is automatically double buffered. But it will work only inside the ACTION callback, although it can be created in any situation. Inside the ACTION callback the application must call cdCanvasActivate and cdCanvasDeactivate.

To use this driver, it must be linked with the "iupcd" library available in the IUP distribution.

In Lua, it is necessary to call function cdluaiup_open() after a call to function cdlua_open(), apart from linking with the "iupluacd" library. This is not necessary if you do require"iupluacd".

### Behavior of Functions

#### Control

- Flush: draws the contents of the image into the window.
- Play: does nothing, returns CD_ERROR.

#### Coordinate System and Clipping

- UpdateYAxis: the orientation of axis Y is the opposite to its orientation in the CD library.

#### Primitives

- Floating point primitives are NOT supported.
- Begin: does not supports CD_BEZIER, and CD_PATH is simulated.

#### Attributes

- WriteMode: does nothing. There is no support for XOR or NOT_XOR.
- BackOpacity: does nothing. It is always transparent.
- Hatch: does nothing.
- Stipple: does nothing.
- Pattern: does nothing.
- LineStyle: Does not supports CD_DASH_DOT_DOT nor CD_CUSTOM. Does not supports line cap nor line join.
- TextAlignment: is simulated.
- Clipping: only rectangular clipping is supported.

#### Colors

- Palette: does nothing.
- Foreground & Background: accepts the transparency information encoded in the color.

#### Client Images

- GetImageRGB: does nothing.

#### Server Images

- All functions do nothing.

####