Leadtools.ImageProcessing.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
RegionContourPointsCommand Constructor()
See Also  Example
Leadtools.ImageProcessing.Effects Namespace > RegionContourPointsCommand Class > RegionContourPointsCommand Constructor : RegionContourPointsCommand Constructor()



Initializes a new RegionContourPointsCommand class object with default parameters.

Syntax

Visual Basic (Declaration) 
Public Function New()
Visual Basic (Usage)Copy Code
Dim instance As RegionContourPointsCommand()
C# 
public RegionContourPointsCommand()
C++/CLI 
public:
RegionContourPointsCommand();

Example

Run the RegionContourPointsCommand on an image.

Visual BasicCopy Code
Public Sub RegionContourPointsConstructorExample()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   Dim rcRect As Rectangle = New Rectangle(leadImage.Width \ 3, leadImage.Height \ 3, leadImage.Width * 2 \ 3, leadImage.Height * 2 \ 3)
   leadImage.AddEllipseToRegion(Nothing, rcRect, RasterRegionCombineMode.Set)
   Dim command As RegionContourPointsCommand = New RegionContourPointsCommand
   command.XForm = New RasterRegionXForm
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)
   Dim points() As Point = command.Points

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void RegionContourPointsConstructorExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   // Prepare the command 
   Rectangle rcRect = new Rectangle(image.Width/3, image.Height/3, image.Width*2/3, image.Height*2/3); 
   image.AddEllipseToRegion(null, rcRect, RasterRegionCombineMode.Set); 
   RegionContourPointsCommand command = new RegionContourPointsCommand(); 
   command.XForm = new RasterRegionXForm(); 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
   Point[] points = command.Points; 
 
   RasterCodecs.Shutdown(); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also