Gambas Documentation - /comp/gb.qt4/draw

/comp/gb.qt4/draw

# Draw (gb.qt4)

This class is used for drawing on a Picture, or a DrawingArea object.

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

Then you can call any of the drawing methods to draw points, lines, texts, pictures...

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

You cannot draw on a DrawingArea outside of its Draw event handler, unless its Cached property is set. In that case, the DrawingArea acts like a Picture.

Since 3.4

The Draw class is deprecated since Gambas 3.4. It is now emulated through the Paint class.

This class is static.

Static properties | Static methods | Constants
--- | --- | ---

Returns or sets the background color used for drawing brushes or text.
Background
Returns a virtual object used for managing the clipping area of a drawing.
Clip
Return or set the clipping rectangle.
ClipRect
Returns the device being drawn.
Device
Returns or sets the color used by filling drawing methods.
FillColor
Returns or sets the style used by filling drawing methods.
FillStyle
Returns or sets the horizontal origin of the brushes used by filling drawing methods.
FillX
Returns or sets the vertical origin of the brushes used by filling drawing methods.
FillY
Returns or sets the font used for drawing texts.
Font
Returns or sets the foreground color used for drawing brushes, text and lines.
Foreground
A synonymous for the Height property.
H
Returns the height of the area that can be drawn.
Height
Indicates that all drawing primitives combine their pixel colors with the pixel colors of the destination with an exclusive or operation.
Invert
Returns or sets the style used for drawing lines.
LineStyle
Returns or sets the width used for drawing lines.
LineWidth
Returns a virtual class that groups the style drawing methods together.
Style
Indicates that some drawing methods like Draw.Text are transparent, i.e. that they do not fill their background.
Transparent
A synonymous for the Width property.
W
Returns the width of the area that can be drawn.
Width

Draw an arc.
Arc
Begins a new drawing. The device can be one of the following objects:
Begin
Draw a circle or a pie.
Circle
Clears the drawing device with the background color.
Clear
Draw an ellipse or a pie.
Ellipse
Ends a drawing.
End
Fills the specified rectangle with the specified color.
FillRect
Draws an Image, or part of it.
Image
Draws a line.
Line
Draws a Picture, or part of it.
Picture
Draws a single pixel.
Point
Draws a polyline, i.e. a void polygon.
PolyLine
Draws a polygon.
Polygon
Draws a rectangle.
Rect
Resets the transformation matrix.
Reset
Restore the state of all drawing properties that were previously saved by the Save method.
Restore
Draws a piece of rich text.
RichText
Returns the height of a piece of rich text.
RichTextHeight
Returns the width of a piece of rich text.
RichTextWidth
Saves the state of all drawing properties.
Save
Modify the transformation matrix so that drawing are scaled by the specified vector.
Scale
Draws a text.
Text
Returns the height of a text drawing.
TextHeight
Returns the width of a text drawing.
TextWidth
Draws a tiled picture.
Tile
Modify the transformation matrix so that drawing are translated by the specified vector.
Translate
Zoom

This constant is used by the style methods for drawing a control in its disable state.
Disabled
This constant is used by the style methods for drawing a control having the focus.
Focus
This constant is used by the style methods for drawing a control hovered by the mouse cursor.
Hover
This constant is used by the style methods for drawing a control in its active state.
Normal