|Please see the Example A.211 - "Crop an image / Manual".|
Piczard allows to "manually" crop an image by using the ImageCrop filter.
This filter has two parameters:
- ImageCrop.Rectangle represents the crop coordinates (x, y, width and height) expressed in pixels.
If Rectangle property is null, then the whole image is selected.
The Rectangle is always expressed in pixels.
You can use the static method ImgeCrop.Calculate to calculate a new ImageCrop class from a rectangle expressed in a different unit of measure. Fore example:
ImageCrop pixelImageCrop = ImageCrop.Calculate(GfxUnit.Inch, new RectangleF(0F, 0F, 1.2F, 2.4F), 300F);
- ImageCrop.CanvasColor indicates the color to apply to the canvas if a part of the ImageCrop.Rectangle is outside the source image.
new ImageCrop(-24, 40, 150, 250, Color.Red).SaveProcessedImageToFileSystem("Source.jpg", "Output.jpg");
Figure 1: An ImageCrop filter applied to an image.
Piczard Fundamentals - Core
Automatic Image Crop