Reference for the Mosaic unit Graphics

Class Overview
Core::Resource
Resources::Bitmap
Graphics::Canvas
Graphics::AttrSet
Graphics::Path
Graphics::ArcPath
Graphics::WarpMatrix
Enumerations
Graphics::ArcStyle
Graphics::FillRule
Graphics::PathCap
Graphics::PathJoin
Graphics::SVGParserStatus
Sets
Graphics::Edges

The unit 'Graphics' provides the fundamental classes needed to perform graphical operations:

enum ArcStyle
{
item Arc;
item Segment;
item Pie;
item PieRounded;
item PieRoundedStart;
item PieRoundedEnd;
}

The definition Graphics::ArcStyle enumerates the possible shapes of an elliptical arc. It is used to determine the mode how Graphics::ArcPath should calculate the path data.

Items Description
Arc Simple elliptical arc. The both arc ends remain opened unless the angle of the arc is equal to or greater than 360.0 degree.
Pie Shape typical for displaying pie charts. Here the start and the end positions of the arc are connected with the center of the ellipse by additional straight line segments. If the arc forms a closed ellipse (the angle of the arc is equal to or greater than 360.0 degree), no line segments are added as connections with the center position.
PieRounded Shape typical for displaying circular bar diagrams with rounded start and end edges. Here the start and the end positions of the arc are connected with the center of the ellipse by additional semi-circles. If the arc forms a closed ellipse (the angle of the arc is equal to or greater than 360.0 degree), no connections with the center position is added.
PieRoundedEnd Shape typical for displaying circular bar diagrams with rounded end edges. Here the start position of the arc is connected with the center of the ellipse by additional straight line segment. The end position, in turn, is connected with the center by a semi-circle. If the arc forms a closed ellipse (the angle of the arc is equal to or greater than 360.0 degree), no connections with the center position is added.
PieRoundedStart Shape typical for displaying circular bar diagrams with rounded start edges. Here the start position of the arc is connected with the center of the ellipse by additional semi-circle. The end position, in turn, is connected by a straight line segment. If the arc forms a closed ellipse (the angle of the arc is equal to or greater than 360.0 degree), no connections with the center position is added.
Segment Segment of an ellipse with the start and the end positions of the arc being connected together by a straight line segment. If the arc forms a closed ellipse (the angle of the arc is equal to or greater than 360.0 degree), no line segment is added.

 

enum FillRule
{
item EvenOdd;
item NonZero;
}

The definition Graphics::FillRule enumerates the possible modes how complex polygons consisting of nested paths are filled. It is used to determine how Views::FillPath should fill the path.

Items Description
EvenOdd Fills the path areas alternately depending on the nesting level of the closed paths. An area is considered as filled if the number of path segments between a point lying inside the area and any point outside the entire shape is odd. If the number of path segments is even, the area is not filled.
NonZero Fills the path areas depending on the nesting level of the closed paths and their winding direction. An area is considered as filled when counting the path segments between a point lying inside the area and any point outside the entire shape the resulting value is not zero, whereby paths with positive winding direction increment the value while paths with negative winding decrement it. If the counter value is 0, the area is not filled.

 

enum PathCap
{
item Flat;
item Square;
item Round;
item Triangle;
}

The definition Graphics::PathCap enumerates the possible modes how the path caps are displayed when stroking the path with path thickness greater than 1 pixel. It is used to determine how Views::StrokePath should raster the path.

Items Description
Flat The path caps are squared off just at the corresponding path cap position.
Round The path caps are extended by the half of a circle with diameter equal to the thickness of the stroked path.
Square The path caps are extended by the half of the thickness of the stroked path and then squared off.
Triangle The path caps are extended by a triangle with height of the half of the thickness of the stroked path.

 

enum PathJoin
{
item Bevel;
item Miter;
item Round;
}

The definition Graphics::PathJoin enumerates the possible modes how the edges of a path are connected when stroking the path with path thickness greater than 1 pixel. It is used to determine how Views::StrokePath should raster the path.

Items Description
Bevel The path segments are joined by connecting their outside edges with a single straight line segment.
Miter The path segments are joined by extending their outside edges until they intersect.
Round The path segments are joined by rounding the corners lying in between. The diameter of the used circle corresponds to the thickness of the stroked path.

 

enum SVGParserStatus
{
item Success;
item EmptyString;
item SyntaxError;
item InvalidArgument;
item OutOfMemory;
}

The definition Graphics::SVGParserStatus enumerates the possible error states of the SVG string parser implemented in the method Graphics::Path.CreateFromSVGString().

Items Description
EmptyString No SVG string content to parse.
InvalidArgument Parsing has been aborted due to a found invalid argument in the SVG string (one parameter or combination of the parameters is not correct). The respective position within the string can be queried by using the method Graphics::Path.GetSVGParserErrorPos().
OutOfMemory Not enough memory for the complete path data. The respective position within the string at which the processing has been aborted can be queried by using the method Graphics::Path.GetSVGParserErrorPos().
Success SVG string could be processed successfully.
SyntaxError Parsing has been aborted due to a syntax error in the SVG string. The respecitive position within the string can be queried by using the method Graphics::Path.GetSVGParserErrorPos().

 

set Edges
{
item Left;
item Top;
item Right;
item Bottom;
item Interior;
}

The definition Graphics::Edges enumerates the parts of a free scalable frame. It is used to determine, which parts should be drawn.

Items Description
Bottom The item 'Bottom' determines whether the bottom edge of the frame should be drawn.
Interior The item 'Interior' determines whether the interior area of the frame should be drawn.
Left The item 'Left' determines whether the left edge of the frame should be drawn.
Right The item 'Right' determines whether the right edge of the frame should be drawn.
Top The item 'Top' determines whether the top edge of the frame should be drawn.