Description |
XGraphicDevice is a context in which graphic object can be created and drawn. There are two methods to use XGraphicDevice
The most simple way is to use one graphic device in this case you only need to create the objects to draw in this device, every time it has to be redrawn (when the method Draw() of the owning window is called) you call the method Draw() of the device.
If you have a litle bit more objects you should use this method because it works faster. Create one device in memory (the second parameter of the constructor must be TRUE) and create the objects to draw on this device. Only call Draw() if you have inserted/removed one or more objcts. Create a second graphic device associated to the owning window. If the method Draw() of the owning window is called, copy the content of the memory-device to the window-associated device with Copy().
Draw |
Draw the contents.
SetBackgroundColor |
XColor * color color to fill the background with
Set the background color (only used if fillBackgound is set TRUE in the constructor)
XGraphicDevice |
XWindow * window | window to draw to (if XGraphicDevice is not constructed in memory) | ||||||
BOOL memory | construct in memory (default is FALSE) | ||||||
BOOL fillBackground | fill the background | ||||||
LONG mode | mode, possible values:
|
Constructs a grphic device where objects like XLine, XText etc can be drawn
Copy |
XGraphicDevice * source | the source from which to copy |
XRect * targetRect | rectangle which defines the target |
XRect * sourceRect | rectangle which defines the source (default is NULL). If the width of the rect is set greater zero, the content will be stretched |
Copy the content of one graphic to another