﻿ Points Property (RasterCurve) | Leadtools | Raster, Medical, Document Help
←Select platform
In This Topic ▼

# Points Property

Summary
The curve points.
Syntax
C#
C++/CLI
Java
Python
``public IList<LeadPoint> Points { get; } ``
``public RasterCollection<LeadPoint> getPoints(); ``
````public: `
`property IList<LeadPoint>^] Points { `
`   IList<LeadPoint>^] get(); `
`} ````
``Points # get  (RasterCurve) ``

#### Property Value

A collection of LeadPoint objects that define the curve points.

Remarks

The number of points in the Points collection obey the following rules:

• If Type is RasterCurveType.Bezier, the number of points in Points must be 3n + 1, where n >= 1. For example, the number of points can be 4, 7, 10, 13, and so on.
• If Type is RasterCurveType.Standard, the number of points in Points must be greater than or equal to 3. For example, the number of points can be 3, 4, 5, 6, and so on.
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:\LEADTOOLS22\Resources\Images"; `
`} ````
Requirements