←Select platform

FillMode Property

Summary
Gets or sets a value that indicates how to handle complex crossing lines.
Syntax
C#
C++/CLI
Java
Python
public LeadFillMode FillMode { get; set; } 
public LeadFillMode getFillMode(); 
public void setFillMode( 
   LeadFillMode leadFillMode 
); 
public: 
property LeadFillMode FillMode { 
   LeadFillMode get(); 
   void set (    LeadFillMode ); 
} 
FillMode # get and set (RasterCurve) 

Property Value

A LeadFillMode enumeration value that indicates how to handle complex crossing lines.

Remarks
Value Meaning
LeadFillMode.Winding All pixels that are inside the resulting exterior lines are in the region.
LeadFillMode.Alternate The region includes the area between odd-numbered and even-numbered polygon sides on each scan line.
Curve Fill Mode
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
 
public void RasterCurveExample() 
{ 
	string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1_curveinverted.bmp"); 
 
	// create a new curve object 
	RasterCurve curve = new RasterCurve(); 
 
	// define the curve 
	curve.Points.Add(new LeadPoint(30, 30)); 
	curve.Points.Add(new LeadPoint(30, 200)); 
	curve.Points.Add(new LeadPoint(130, 130)); 
	curve.Points.Add(new LeadPoint(75, 75)); 
	curve.Points.Add(new LeadPoint(130, 30)); 
 
	curve.Type = RasterCurveType.Standard; 
	curve.FillMode = LeadFillMode.Winding; 
	curve.Tension = 0.5; 
	curve.Close = RasterCurveClose.Close; 
 
	// create an image 
 
	using (RasterImage image = new RasterImage( 
	   RasterMemoryFlags.Conventional, 
	   250, 
	   250, 
	   24, 
	   RasterByteOrder.Bgr, 
	   RasterViewPerspective.BottomLeft, 
	   null, 
	   IntPtr.Zero, 
	   0)) 
	{ 
		Assert.IsNotNull(image); 
 
		// fill the image 
		new FillCommand(RasterColor.FromKnownColor(RasterKnownColor.Magenta)).Run(image); 
		image.AddCurveToRegion(null, curve, RasterRegionCombineMode.Set); 
 
		// do something with the region 
		new InvertCommand().Run(image); 
 
		// save the image 
		using (RasterCodecs codecs = new RasterCodecs()) 
		{ 
			// save the image back to disk 
			codecs.Save(image, destFileName, RasterImageFormat.Bmp, 24); 
		} 
	} 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.5.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.