comp • gb.qt4 • paint

Paint (gb.qt4)

This class is used for doing anti-aliased painting on the following objects:

Before starting drawing anything, you must call the Paint.Begin method by passing it the object you want to draw.

Then you can draw what you want in three steps:

When your drawing is finished, you must call the Paint.End method.

The interface of that class is very closed to the Cairo drawing model.

This class is static.

Static properties

Static methods Constants
Return or set if the painting will be anti-aliased.
AntiAlias  
Return or set the background color.
Background  
Returns or sets the brush used for drawing.
Brush  
Return or set the brush origin.
BrushOrigin  
Computes a bounding box in user coordinates covering the area inside the current clip.
ClipExtents  
Return or set the clipping region as a rectangle.
ClipRect  
Returns or sets the dash pattern to be used by Paint.Stroke.
Dash  
Returns or sets the offset used for drawing dashes.
DashOffset  
Returns the device you are drawing on with the Paint class.
Device  
Returns or sets the current fill rule within the current drawing.
FillRule  
Returns or sets the font used for painting text.
Font  
Returns the height of the device being painted.
H  
Returns the height of the device being painted.
Height  
Returns or sets the current line cap style within the current paiting.
LineCap  
Returns or sets the current line join style within the current painting.
LineJoin  
Returns or sets the current line width. The line width value specifies the diameter of a pen that is circular in user space, though device-space pen may be an ellipse in general due to scaling/shear/rotation of the current transformation matrix (CTM).
LineWidth  
Returns or sets the current transformation matrix.
Matrix  
Returns or sets the current miter limit.
MiterLimit  
Returns or sets the compositing operator to be used for all drawing operations. See each one of the constants below for details on the semantics of each available compositing operator.
Operator  
Computes a bounding box in user-space coordinates covering the points on the current path.
PathExtents  
Return a array of polygons corresponding to the current drawing path.
PathOutline  
Returns the horizontal resolution of the device being painted.
ResolutionX  
Returns the vertical resolution of the device being painted.
ResolutionY  
Returns the width of the device being painted.
W  
Returns the width of the device being painted.
Width  
Returns the X coordinate of the current point.
X  
Returns the Y coordinate of the current point.
Y  
Adds a circular arc of the given Radius to the current path. The arc is centered at (XC, YC), begins at Angle and proceeds counter-clockwise during Length radians.
Arc  
Starts painting on the specified device.
Begin  
Establishes a new clip region by intersecting the current clip region with the current path as it would be filled by Paint.Fill and according to the current fill rule (see Paint.FillRule).
Clip  
Adds a line segment to the path from the current point to the beginning of the current sub-path, (the most recent point passed to Paint.MoveTo), and closes this sub-path. After this call the current point will be at the joined endpoint of the sub-path.
ClosePath  
Creates a new brush corresponding to an opaque or translucent color.
Color  
Adds a cubic B├ęzier spline to the path from the current point to position (X3, Y3) in user-space coordinates, using (X1, Y1) and (X2, Y2) as the control points. After this call the current point will be (X3, Y3).
CurveTo  
Draw an Image, or part of it.
DrawImage  
Draw a Picture, or part of it.
DrawPicture  
DrawRect  
Draws a piece of rich text.
DrawRichText  
Draw the shadow of a rich text.
DrawRichTextShadow  
Draws the specified text.
DrawText  
Draw the shadow of a text.
DrawTextShadow  
Adds an elliptic arc to the current path. The ellipse is defined by its (X, Y, Width, Height) bounding-box, begins at Angle and proceeds counter-clockwise during Length radians.
Ellipse  
Ends a painting.
End  
A drawing operator that fills the current path according to the current fill rule, (each sub-path is implicitly closed before being filled).
Fill  
Fill a rectangle with a specific color.
FillRect  
Creates a new brush from an image.
Image  
Adds a line to the path from the current point to position (X, Y) in user-space coordinates. After this call the current point will be (X, Y).
LineTo  
Creates a new linear gradient brush along the line defined by (X0, Y0) and (X1, Y1), and using color stops defined by the Colors and Positions arguments.
LinearGradient  
Begin a new sub-path. After this call the current point will be (X, Y).
MoveTo  
Clears the current path. After this call there will be no path and no current point.
NewPath  
Tests whether the given point is inside the area described by the current path. Device dimensions and clipping are not taken into account.
PathContains  
Add a closed sub-path polygon to the current path.
Polygon  
Creates a new radial gradient paint brush that interpolates colors between a focal point ( FX , FY ) and end points on a circle defined by ( CX0 , CY0 , Radius0 ), and using color stops defined by the Colors and Positions arguments.
RadialGradient  
Adds a closed sub-path rectangle of the given size to the current path at position (X, Y) in user-space coordinates.
Rectangle  
Relative-coordinate version of CurveTo.
RelCurveTo  
Relative-coordinate version of LineTo.
RelLineTo  
Begin a new sub-path. After this call the current point will be offset by (X, Y).
RelMoveTo  
Resets the transformation matrix to the identity.
Reset  
Reset the current clip region to its original, unrestricted state. That is, set the clip region to an infinitely large shape containing the target surface. Equivalently, if infinity is too hard to grasp, one can imagine the clip region being reset to the exact bounds of the target surface.
ResetClip  
Restores the drawing state to the state saved by a preceding call to Save and removes that state from the stack of saved states.
Restore  
Adds the specified rich text to the current path, using the current font defined by the Font property.
RichText  
Gets the extents for a string of rich text.
RichTextExtents  
Return the bounding box needed by a string of rich text.
RichTextSize  
Modifies the current transformation matrix (CTM) by rotating the user-space axes by angle radians. The rotation of the axes takes places after any existing transformation of user space. The rotation direction for positive angles is from the positive X axis toward the positive Y axis.
Rotate  
Makes a copy of the current drawing state and saves it on an internal stack of saved states.
Save  
Modifies the current transformation matrix (CTM) by scaling the X and Y user-space axes by sx and sy respectively. The scaling of the axes takes place after any existing transformation of user space.
Scale  
StretchImage  
A drawing operator that strokes the current path according to the current line width, line join, line cap, and dash settings.
Stroke  
Adds the specified text to the current path, using the current font defined by the Font property.
Text  
Gets the extents for a string of text.
TextExtents  
Return the bounding box needed by a string of text.
TextSize  
Modifies the current transformation matrix (CTM) by translating the user-space origin by (TX, TY).
Translate  
Return a trimmed version of the specified rich text so that it fits the requested rectangle.
TrimRichText  
Return a trimmed version of the specified text so that it fits the requested rectangle.
TrimText  
Draw a quick zoomed version of an image or a part of it.
ZoomImage  
Pixels outside of the brush copy the closest pixel.
ExtendPad  
The brush is tiled by reflecting at the edges.
ExtendReflect  
The pattern is tiled by repeating.
ExtendRepeat  
Constant used to select how paths are filled.
FillRuleEvenOdd  
Constant used to select how paths are filled.
FillRuleWinding  
Specifies to render the endpoints of the path when stroking by starting(stopping) the line exactly at the start(end) point.
LineCapButt  
Specifies to render the endpoints of the path when stroking by using a round ending, the center of the circle being the end point.
LineCapRound  
Specifies to render the endpoints of the path when stroking by using squared ending, the center of the square being the end point.
LineCapSquare  
Specifies to render the junction of two lines by using a cut-off join, the join being cut off at half the line width from the joint point.
LineJoinBevel  
Specifies to render the junction of two lines by using a sharp (angled) corner.
LineJoinMiter  
Specifies to render the junction of two lines by using a rounded join, the center of the circle being the joint point.
LineJoinRound  
Compositing operator that draws the source on top of destination content and only there.
OperatorATop  
Compositing operator that accumulates the source and destination layers.
OperatorAdd  
Compositing operator that clears the destination layer (bounded).
OperatorClear  
Compositing operator that ignores the source.
OperatorDest  
Compositing operator that leaves the destination on top of source content and only there (unbounded).
OperatorDestATop  
Compositing operator that leaves the destination only where there was source content (unbounded).
OperatorDestIn  
Compositing operator that leaves the destination only where there was no source content.
OperatorDestOut  
Compositing operator that draws the destination on top of the source.
OperatorDestOver  
Compositing operator that draws the source where there was destination content (unbounded).
OperatorIn  
Compositing operator that draws the source where there was no destination content (unbounded).
OperatorOut  
Compositing operator that draws the source layer on top of the destination layer (bounded).
OperatorOver  
Compositing operator that behaves like OperatorOver, but assuming source and dest are disjoint geometries.
OperatorSaturate  
Compositing operator that replaces the destination layer (bounded).
OperatorSource  
Compositing operator that shows source and destination where there is only one of them.
OperatorXor