ImageGear .NET v25.2 - Updated
fillRule Property

ImageGear.Web.UI Library > ImageGear.Web.UI Namespace > Mark class : fillRule Property
Specifies the fill rule of polygon mark.
Syntax
ASP.NET Ajax Javascript (Specification) 
function get_fillRule() : FillRule
function set_fillRule(value : FillRule)
ASP.NET Ajax Javascript (Usage) 
var resultVar = instanceOfMark.get_fillRule();
Example

This JavaScript code will create the polygon mark with fillRule property is ImageGear.Web.UI.FillRule.NonZero.

var mark = new ImageGear.Web.UI.Mark(ImageGear.Web.UI.MarkType.Polygon);

// Set various properties.
var points = mark.get_points();
points.addPoint({ x: 250, y: 75 });
points.addPoint({ x: 323, y: 301 });
points.addPoint({ x: 131, y: 161 });
points.addPoint({ x: 369, y: 161 });
points.addPoint({ x: 177, y: 301 });
mark.set_fillColor('#a0e0f0');
mark.set_fillRule(ImageGear.Web.UI.FillRule.NonZero);

// Add the mark to the page.
// Adding it after setting the properties avoids a lot of needless markChanged events.
$find('PageView1').get_artPage().addMark(mark);
Remarks

This property specifies the fill rule of polygon mark. You can select one of two ways of polygon mark fill.

ImageGear.Web.UI.FillRule.EvenOdd value determines the "insideness" of a point on the canvas by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.

ImageGear.Web.UI.FillRule.NonZero value determines the "insideness" of a point on the canvas by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.

Mark types: This property is valid for Polygon marks.
Valid values: Any member of the FillRule enumeration.
Default value: ImageGear.Web.UI.FillRule.EvenOdd (value is 0)

See Also

Reference

Mark class
Mark Members

Is this page helpful?
Yes No
Thanks for your feedback.