GDI+ Base Driver

This driver represents a base driver for all system-dependent drivers implemented in the Microsoft Windows system, but uses a new API called GDI+. The drivers Clipboard, Native Window, IUP, Image, Printer, EMF and Double Buffer were implemented. The driver WMF, and the function cdPlay of the Clipboard and EMF drivers were not implemented using GDI+.

It can be used only as the context plus driver of the GDI based drivers.

The main motivation for the use of GDI+ was transparency for all the primitives. Beyond that we got other features like anti-aliasing, gradient filling, bezier lines and filled cardinal splines.

This driver still does not completely replace the GDI Windows base driver, because GDI+ does not have support for XOR. Also the applications need to adapt the rendering of text that is slightly different from GDI. It is know that GDI+ can be slower than GDI in some cases and faster in other cases, Microsoft does not make this clear.

So we let the programmer to choose what to use. We created the function cdUseContextPlus that allows to activate or to deactivate the use of GDI+ for the GDI based drivers. This function affects only the cdCreateCanvas function call, once created the canvas will be always a GDI+ canvas. In fact the function affects primary the definitions CD_NATIVEWINDOW, CD_IMAGE, CD_PRINTER, CD_EMF, CD_DBUFFER and CD_CLIPBOARD, because they are function calls and not static defines.

Using GDI+ it is allowed to create more that one canvas at the same time for the same Window. And they can co-exist with a standard GDI canvas.

To enable the use of GDI+ based drivers you must call the initialization function cdInitContextPlus once, and link to the libraries "cdcontextplus.lib" and "gdiplus.lib". Also the file "gdiplus.dll" must be available in your system. These files already came with Visual C++ 7 and Windows XP. For other compilers or systems you will need to copy the ".lib" file for you libraries area, and you will need to copy the DLL for the Windows\System (Win98/Me) or Windows\System32 (Win2000/NT4-SP6) folder. The gdiplus files can be obtained from Microsoft or from here.

In CDLua it is not necessary any additional initialization, but the application must still be linked with the cdcontextplus.lib library or a require"cdluacontextplus" can be used when using dynamic libraries.

Behavior of Functions

Control

Coordinate System and Clipping

Primitives

Attributes

Colors

Client Images

Server Images

Exclusive Attributes