DjvuImageCrop Method (Rectangle)
Cropping the image.

Namespace: Aspose.Imaging.FileFormats.Djvu
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 DJVU 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.djvu"))
{
    Aspose.Imaging.FileFormats.Djvu.DjvuImage djvuImage = (Aspose.Imaging.FileFormats.Djvu.DjvuImage)image;

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

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