Gets the handle to a Windows region.
Syntax
Example
Run the BorderRemoveCommand on an image.
Visual Basic | Copy Code |
---|
Public Sub RegionPropertyExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Clean.tif")
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 |
---|
public void RegionPropertyExample() { // Load an image RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "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