You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Paint object:
Cvo_Paint
Cvo_Window
#include
<Cvo/Paint.h++>
new
Cvo_Paint ( char *resource_name,
{ Cvo_Object *parent | Display *display },
[ int width, int height ] )
The Cvo_Paint object provides a canvas on which the application may draw. If width and height are provided, they specify how big the drawable area should be.
The Cvo_Paint object actually has two Cvo_Pixmap objects associated
with it. One is the currently displayed Cvo_Pixmap and the other is
the one in which the application draws, the drawable canvas. Calling
the Flush() member function on the object will cause the
displayable Cvo_Pixmap to be updated with the contents of the
drawable Cvo_Pixmap.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
ResetCanvas (
int width,
int height,
[ BOOL copy ] )
This function resets the size of the canvas on which to draw. If the
copy argument is True, or not provided, the new canvas will
not be erased. If copy is False, the canvas will be erased.
Flush (
)
This function will update the canvas to display the drawable pixmap
and any changes which have been made since the last Flush().
MakeDirty (
)
This function informs the Cvo_Paint object that the drawable pixmap has changed. This only needs to be called if the application writes directly to the drawable pixmap.
Cvo_Pixmap *GetPixmap (
)
This function returns the drawable Cvo_Pixmap.
ConvertCoord (
int *x,
int *y )
This function converts the coordinates pointed to by x and y, which should be valid coordinates in the visible Cvo_Pixmap displayed by the Cvo_Paint object, to the equivalent coordinates in the drawable Cvo_Pixmap canvas.
Erase (
)
This function will erase the drawable and visible Cvo_Pixmap objects.
EraseArea (
int x,
int y,
int width,
int height )
This function erases the area whose origin is (x,y) and whose size is width x height pixels.
This function fills the entire canvas with color.
This function fills the area whose origin is (x,y) and whose size is width x height pixels with color.
SetWidth (
int width )
This function sets the width of lines drawn to be width.
This function draws a line from (x1,y1) to (x2,y2) using color.
This function draws a rectangle of size width x height starting at (x,y) in color.
This function uses the XDrawArc() function to draw an arc in
color.
This functions draw a shape located at (x,y). If size is not passed the shape is about 6 pixels large, otherwise it is about size pixels large.
The shape argument must be one of the following:
CVOP_BOX_SHAPE ( An unfilled square)
CVOP_CIRCLE_SHAPE ( An unfilled circle)
CVOP_DISC_SHAPE ( A filled circle)
CVOP_POINT_SHAPE ( A single pixel)
CVOP_SQUARE_SHAPE ( A filled square)
CVOP_X_SHAPE ( An X)
PanTo (
int x,
int y )
Pan the visible image such that (x,y) in the image is located in the upper right hand corner of the Cvo_Paint object. Cvo will silently modify the x and y value if they are out of range for the image.
int PWidth (
)
int PHeight (
)
Return the width or height of the the image, not of the Cvo_Paint object itself.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoPaint.Sunken
(new value:
True
)
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.