Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
Region Property
See Also  Example
Leadtools.ImageProcessing.Core Namespace > BorderRemoveCommand Class : Region Property




Gets the handle to a Windows region.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Region As Region
Visual Basic (Usage)Copy Code
Dim instance As BorderRemoveCommand
Dim value As Region
 
value = instance.Region
C# 
public Region Region {get;}
Managed Extensions for C++ 
public: __property Region get_Region();
C++/CLI 
public:
property Region Region {
   Region get();
}

Return Value

Handle to a windows region. When BorderRemoveCommand returns, this is updated with a single windows region corresponding to all changes, only if BorderRemoveCommandFlags.SingleRegion has been set in Flags and BorderRemoveCommandFlags.LeadRegion has not been set. To use this, set the Flags to BorderRemoveCommandFlags.SingleRegion. It is the programmer's responsibility to dispose this region when the region is no longer needed.

Example

Visual BasicCopy Code
ImageProcessing.Core.BorderRemoveCommand.Region
   Public Sub RegionPropertyExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Clean.tif")

      ' Prepare the command
      Dim command As BorderRemoveCommand = New BorderRemoveCommand
      command.Border = BorderRemoveBorderFlags.All
      command.Flags = BorderRemoveCommandFlags.UseVariance Or BorderRemoveCommandFlags.SingleRegion
      command.Percent = 20
      command.Variance = 3
      command.WhiteNoiseLength = 9

      command.Run(leadImage)
      leadImage.AddGdiPlusRegionToRegion(Nothing, command.Region, RasterRegionCombineMode.Set)

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Core.BorderRemoveCommand.Region 
      public void RegionPropertyExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Clean.tif"); 
 
         // Prepare the command 
         BorderRemoveCommand command = new BorderRemoveCommand(); 
         command.Border = BorderRemoveBorderFlags.All; 
         command.Flags = BorderRemoveCommandFlags.UseVariance | BorderRemoveCommandFlags.SingleRegion ; 
         command.Percent = 20; 
         command.Variance = 3; 
         command.WhiteNoiseLength = 9; 
 
         command.Run(image); 
         image.AddGdiPlusRegionToRegion(null, command.Region, RasterRegionCombineMode.Set); 
 
         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