Initializes a new
AntiAliasingCommand class object with explicit parameters.
Syntax
Parameters
- threshold
- Threshold value that indicates which pixels to smooth. The application of the anti-aliasing filter on the image associates a value with each pixel. Only pixels with values above this threshold are smoothed. This parameter only accepts positive values.
- dimension
- Value that indicates the size of the anti-aliasing mask. For example, a value of three indicates an anti-aliasing mask of 3 X 3. This parameter only accepts positive values.
- filter
- Flag that indicates the type of anti-aliasing filter to use.
Example
Run the AntiAliasingCommand on an image and does anti-aliasing on it.
Visual Basic | Copy Code |
---|
Public Sub AntiAliasingConstructorExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")
Dim threshold As Integer = 25
Dim dimension As Integer = 7
Dim command As AntiAliasingCommand = New AntiAliasingCommand(threshold, dimension, AntiAliasingCommandType.Type1)
command.Run(leadImage)
codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
public void AntiAliasingConstructorExample() { // 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 int threshold = 25; int dimension = 7; AntiAliasingCommand command = new AntiAliasingCommand(threshold, dimension, AntiAliasingCommandType.Type1); command.Run(image); codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 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