User Tools

Site Tools


k25:k25.1.2:start

25.1.2 Properties and constants of the Cairo class

This chapter presents properties and selected constants of the Cairo class (gb.cairo).

25.1.2.1 Properties

The Cairo class has these properties:

PropertyData typeDescription
AntiAlias BooleanDetermines or specifies with True that the image is drawn with anti-aliasing (edge smoothing).
ClipExtentsCairoExtentsCalculates a bounding box in user coordinates for the area within the current clip → Chapter 25.1.6 CairoExtents
FillExtentsCairoExtentsCalculates a bounding box in user coordinates for the coloured area.
PathExtentsPathExtentsCalculates a bounding box (in coordinates of the CTM) that contains all points of the current path and returns it. If the current path is empty, an empty rectangle is returned. Stroke() parameters, clipping, fill rules and artboard boundaries are ignored.
ThehFloat[ ]Sets the stroke pattern or returns it as a float array. The property is only used in conjunction with the Cairo.Stroke([…]) method. The number of elements in the float array must always be even.
DashOffsetFloatReturns or sets the offset in the dash pattern (in coordinate units).
DeviceObjectSpecifies the object that is drawn to with the Cairo class.
FillRuleIntegerThe fill rule specifies which regions are inside or outside a complex (possibly self-intersecting) path. This property can have one of the following values: FillRuleWinding (default value) or FillRuleEvenOdd.
FontFontSets the font or reads the font with which text is drawn - with the properties Bold, Extents, Italic, Matrix, Name, Size, Slant and Weight of the virtual class .Cairo.Font.
LineCapIntegerDetermines or sets the line end for the current drawing with Cairo.Stroke. This property has one of the following values: LineCapButt (default value) or LineCapRound or LineCapSquare.
LineJoinIntegerDetermines or specifies the way in which lines are joined. This property has one of the following values: LineJoinMiter (default) or LineJoinRound or LineJoinBevel.
LineWidthFloatSets the line thickness or reads the line thickness.
MatrixCairoMatrixSets the current transformation matrix (CTM - Current Transformation Matrix) or returns this matrix → Chapter 23.3.5 CairoMatrix.
MiterLimitFloatSets the current angle limit or reads out this value in conjunction with the LineJoin property and set value LineJoinMiter.
OperatorIntegerReturns or sets the composition operator that is used for all drawing operations. The composition operator determines how colours on the drawing area are linked to colours drawn above them. The standard is OperatorOver, the “draw over”. The following applies to the definition of the operators → http://cairographics.org/operators.
SourceCairoPatternSets the pattern for drawing or returns the value.
StatusIntegerReturns an error status value - overview of the numerous error status values → http://gambaswiki.org/wiki/comp/gb.cairo/cairo/status.
StrokeExtentsCairoExtentsReturns a bounding box (in coordinates of the CTM) resulting from the current path in the Stroke() method.
ToleranceFloatSets the tolerance value [0..1] for the approximation of curve segments by a polygon move. The default value is 0.1.

Table 25.1.2.1.1 : Properties of the Cairo class

25.1.2.2 Selected constants

Only a few selected constants are described for the Cairo class.
Further constants and information can be found at → http://gambaswiki.org/wiki/comp/gb.cairo/cairo.

ConstantValueDescription
LineCapButt0Specifies the rendering of the start and end points exactly at the point boundary in connection with the method Cairo.Stroke.
LineCapRound1Specifies the rendering of the start and end points with a circular end, where the centre of the end circle is exactly the start and end point.
LineCapSquare2Specifies the rendering of the start and end points with a square end, where the centre of the square is the exact start and end point.
ExtendRepeat1The pattern is tiled by repeating.
ExtendReflect2The pattern is tiled by reflection at the edges.
ExtendPad3Pixels that lie outside the pattern are given the colour of the nearest pixel within the pattern.

Table 25.1.2.2.1 : Selected constants of the Cairo class

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k25/k25.1.2/start.txt · Last modified: 20.02.2024 by emma

Page Tools