TiffImageCrop Method (Rectangle)
Cropping the image.

Namespace: Aspose.Imaging.FileFormats.Tiff
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.04
Syntax
public override void Crop(
	Rectangle rectangle
)

Parameters

rectangle
Type: Aspose.ImagingRectangle
The rectangle.
Examples
The following example crops a TIFF image. The cropping area is be specified via Aspose.Imaging.Rectangle.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
    Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;

    // Crop the image. The cropping area is the rectangular central area of the image.
    Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(tiffImage.Width / 4, tiffImage.Height / 4, tiffImage.Width / 2, tiffImage.Height / 2);
    tiffImage.Crop(area);

    // Save the cropped image to PNG
    tiffImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
See Also