// TRect with rotation overload. Angles are degrees clockwise procedure Crop(Rect: TRect; Rotation: double; AntialiasMode: TIEAntialiasMode = ierFast);
// Perspective fix overload procedure Crop(Quadrilater: array of TDPoint); overload;
Description
Replace the current image with that within the specified rectangle (i.e. keep only the specified region).
The Perspective fix overload allows you to adjust images that have perspective distortion. You need to specify the four points that will become the corners of the new image. The order is as follows: ◼Top-Left corner ◼Top-right corner ◼Bottom-right corner ◼Bottom-Left corner
Note: ◼Negative or out-of-range values will enlarge the image. FillColor will be used for the new areas. clNone can be specified for alpha fill ◼For other image editing functions, you can use Proc
Rotate and Crop Explanation
The Rotate and Crop overload rotates the whole image and the crops to a region of interest by adjusting the crop region to account for the rotation.
// Crop the image at position, Top-Left: (20, 20), Bottom-right: (100, 100). The resulting image will be 80 x 80 pixels IEBmp.Crop( 20, 20, 100, 100 );
// Crop to the rect(100, 100, 300, 200) and rotate image 20 deg. Clock-wise IEBmp.Crop( rect( 100, 100, 300, 200 ), 20, ierBicubic );
// Crops to the specified quadrilateral (4 points that will become the new corners) and applies forward perspective mapping. Useful to adjust perspective distortion IEBmp.Crop([ DPoint(104, 85), // Top-Left corner DPoint(1000, 150), // Top-right corner DPoint(181, 500), // Bottom-right corner DPoint(54, 400) // Bottom-Left corner ]);