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



Gets the contour coordinates of a region.

Syntax

Visual Basic (Declaration) 
Public Class RegionContourPointsCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As RegionContourPointsCommand
C# 
public class RegionContourPointsCommand : RasterCommand, IRasterCommand  
C++/CLI 
public ref class RegionContourPointsCommand : public RasterCommand, IRasterCommand  

Example

Run the RegionContourPointsCommand on an image.

Visual BasicCopy Code
Public Sub RegionContourPointsCommandExample()
   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(Nothing)
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

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

   // 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(null); 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
 
   RasterCodecs.Shutdown(); 
}

Remarks

  • This command works only on images having a region. If the image does not have a region the command returns the error: Not Initialized.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Effects.RegionContourPointsCommand

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