Reference for the Mosaic class Views::StrokePath
The class Views::StrokePath provides a kind of view specialized to stroke a path. The coordinates of the path line segments are provided in a Graphics::Path object assigned to the property Path. The position and the size of the area to display the path are determined by the property Bounds. The color to use when stroking the path is defined by the property Color. Alternatively, the path can be stroked with a color gradient specified by the properties ColorTL, ColorTR, ColorBL and ColorBR. For each view's corner different color can be set.
The thickness of the stroked path is controlled by the property Width. With the properties StartCap and EndCap the appearance of the path ends, if the path is opened, can be determined. The properties JoinPoints and MiterLimit control the appearance of path corners, the join points between path line segments.
With the property FlipY and Offset you can control the orientation and the origin position of the path coordinate system. Finally, the property Quality determines whether the paths is rasterized with or without antialiasing.
The visibility of the stroked path is controlled by the properties Visible and Embedded. In particular the property Embedded can determine whether the corresponding view is limited (== embedded) to the boundary of a sibling Core::Outline view or not. The embedding of views within a Core::Outline allows a kind of sub-groups within the GUI component itself. Very useful for any kind of scrollable lists, menus, etc.
Finally, the property Buffered controls whether the view should store its aspect in an off-screen bitmap. This feature is useful to optimize screen update avoiding the rasterization of the path.
property bool Buffered = false;
The property 'Buffered' determines whether the view should manage an internal off-screen bitmap containing the rasterized path. Such buffered views are drawn faster when they are moved or faded-in/out because the rasterization of the path can be omitted.
Please note, buffered views may occupy a lot of video memory. Use this feature with prudence, e.g. during active animations only. After the animation is done, set the property to the value 'false' in order to free the video memory.
property color Color = #FFFFFFFF;
The property 'Color' controls the color of the entire path. Thus this property is useful if no gradients are desired. The resulting colors can additionally be modulated by the values specified in the properties ColorTL, ColorTR, ColorBL and ColorBR.
property color ColorBL = #FFFFFFFF;
The property 'ColorBL' stores the color at the bottom-left corner of the Bounds area. This color value can additionally be modulated by the common color value stored in the property Color.
property color ColorBR = #FFFFFFFF;
The property 'ColorBR' stores the color at the bottom-right corner of the Bounds area. This color value can additionally be modulated by the common color value stored in the property Color.
property color ColorTL = #FFFFFFFF;
The property 'ColorTL' stores the color at the top-left corner of the Bounds area. This color value can additionally be modulated by the common color value stored in the property Color.
property color ColorTR = #FFFFFFFF;
The property 'ColorTR' stores the color at the top-right corner of the Bounds area. This color value can additionally be modulated by the common color value stored in the property Color.
property bool Embedded = false;
The property 'Embedded' controls how the view should appear and behave within its superior Owner. If this property == 'true', the affected view will be embedded (limited) to the boundary of a preceding Core::Outline sibling view. This is as if the view had been embedded within this outline. Beside the appearance limitation of the outline boundary, the outline also provides more sophisticated arrangement mechanisms and the content scrolling. It is therefore useful to create scrollable menus or lists.
If this property is 'false', the view is considered as a regular view of its Owner - it doesn't belong to any outline.
property Graphics::PathCap EndCap = Graphics::PathCap.Flat;
The property 'EndCap' determines how to rasterize the area at the end of every opened path. Following values are possible:
property bool FlipY = false;
The property 'FlipY' controls the vertical orientation and the position of the origin of the coordinate system of the Path assigned to this view.
If this property is 'false', the coordinates provided within the Path object are assumed as being relative to the top-left corner of the Bounds area with the Y-axis pointing downwards. If the property FlipY is 'true', the coordinates are relative to the bottom-left corner with the positive Y-axis pointing upwards. Please note, the origin position can additionally be moved by using the property Offset.
property Graphics::PathJoin JoinPoints = Graphics::PathJoin.Bevel;
The property 'JoinPoints' determines how to rasterize the areas where two path segments join together. Following values are possible:
property float MiterLimit = 3.0;
The property 'MiterLimit' determines the maximum ratio between the resulting length of the miter and the half of the thickness (Width) of the stroked path. If this limit is exceeded, the affected corner is rasterized wth the Bevel mode instead of Miter.
property point Offset = <0,0>;
The property 'Offset' specifies an additional displacement to add to the coordinates provided within the Path object when the path is rasterized on the screen. Changing this property allows the view to scroll the rasterized image of the path.
property Graphics::Path Path = null;
The property 'Path' refers to an object containing the coordinates of the path to stroke. From the path data the view rasters line segments with the thickness specified in the property Width. At the runtime, when the content of the associated path object changes, the view is updated automatically.
The coordinates provided within the path object are assumed as being relative to the top-left corner of the Bounds area with the Y-axis pointing downwards. If the property FlipY is 'true', the coordinates are relative to the bottom-left corner with the positive Y-axis pointing upwards. This origin can additionally be moved by using the property Offset.
property bool Quality = true;
The property 'Quality' determines whether the path rasterization should be performed with an additional antialiasing. The usage of the antialiasing produces better and smooth outputs. Without antialiasing the edges of the path appear with steps. Depending on the underlying graphics system, an active antialiasing may impact the resulting performance. Therefore it's up to you to decide which part of the GUI should appear with the higher quality. To activate the antialiasing assign 'true' to this property.
property Graphics::PathCap StartCap = Graphics::PathCap.Flat;
The property 'StartCap' determines how to rasterize the area at the begin of every opened path. Following values are possible:
property bool Visible = true;
The property 'Visible' determines the visibility state of the view. Invisible views will not appear on the screen. Whether a view is really visible depends on the visibility of its Owner and the position of the view within the owners boundary area.
property float Width = 1.0;
The property 'Width' determines the thickness of the path to stroke. It is expressed in pixel.