How to C#: Imaging
Using Imaging SDK for C#.NET
Winforms Controls
Image Load
Image Access and Modify
Geometry: Crop
Geometry: Crop
Home ›› XImage.Raster ›› C# Raster: Crop Image according to Specified Size

How to C#: Crop Image according to Specified Size

Guide for How to Crop Image

Crop Image Size

By using the XImage.Raster SDK, you can crop the current image to the specified valid size.

Sample Code (crop current image to specified size):

RasterImage img = new RasterImage(@"F:\input.tif");
ImageProcess process = new ImageProcess(img);
//Crop the image to the specified size, X coordinate is 10, Y coordinate is 20, and the target size is 200x200.
process.CropImage(new Rectangle(10, 20, 200, 200));
//Only crop the second page of the input tif
process.CropImage(new Rectangle(10, 20, 200, 200), 1);