public void AddCurveToRegion(RasterRegionXForm xform,RasterCurve curve,RasterRegionCombineMode combineMode)
public void addCurveToRegion(RasterRegionXForm xform,RasterCurve curve,RasterRegionCombineMode combineMode)
public:void AddCurveToRegion(RasterRegionXForm^ xform,RasterCurve^ curve,RasterRegionCombineMode combineMode)
def AddCurveToRegion(self,xform,curve,combineMode):
xform
RasterRegionXForm object that LEADTOOLS uses to translate between display coordinates and image coordinates. If you specify null in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the image view perspective.
curve
A RasterCurve object that specifies the curve region. You specify the curve using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the xform.
combineMode
The action to take regarding the existing image region, if one is defined.
To update an existing region, you specify how the new region is to be combined with the existing one using the combineMode parameter. For more information, refer to RasterRegionCombineMode.
For more information, refer to Creating a Region.
For more information, refer to Saving A Region.
For more information, refer to Working with the Existing Region.
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 objectRasterCurve curve = new RasterCurve();// define the curvecurve.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 imageusing (RasterImage image = new RasterImage(RasterMemoryFlags.Conventional,250,250,24,RasterByteOrder.Bgr,RasterViewPerspective.BottomLeft,null,IntPtr.Zero,0)){Assert.IsNotNull(image);// fill the imagenew FillCommand(RasterColor.FromKnownColor(RasterKnownColor.Magenta)).Run(image);image.AddCurveToRegion(null, curve, RasterRegionCombineMode.Set);// do something with the regionnew InvertCommand().Run(image);// save the imageusing (RasterCodecs codecs = new RasterCodecs()){// save the image back to diskcodecs.Save(image, destFileName, RasterImageFormat.Bmp, 24);}}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
