AutoCropRectangleCommand Class (original) (raw)
Summary
Gets the rectangle to be used to trim the image if AutoCropCommand were used.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTAutoCropRectangleCommand : LTRasterCommand
public class AutoCropRectangleCommand
extends RasterCommand
class AutoCropRectangleCommand(RasterCommand):
Example
Run the AutoCropRectangleCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void AutoCropRectangleCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));
// Prepare the command
AutoCropRectangleCommand command = new AutoCropRectangleCommand();
command.Threshold = 0;
command.Run(image);
MessageBox.Show("Left = " + command.Rectangle.Left.ToString() + "\n" +
"Top = " + command.Rectangle.Top.ToString() + "\n" +
"Right = " + command.Rectangle.Right.ToString() + "\n" +
"Bottom = " + command.Rectangle.Bottom.ToString());
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Leadtools.ImageProcessing.Core Assembly