ImageEn, unit iexUserInteractions

TIECropToolInteraction


Declaration

TIECropToolInteraction = class(TIEUserInteraction);


Description

A class of TIEUserInteraction that controls interaction for the crop tool (when MouseInteractGeneral is miCropTool).

The crop tool allows the user to select an area of the image to keep and then click "Enter" to apply the crop. The selection can also be rotated so the image is rotated and then cropped.

In Crop Tool mode:
- User can resize crop box by dragging grips
- User can rotate crop by dragging outside grips
- User can click "Enter" to enact the crop
- User can click "Esc" to cancel the crop

Notes:
- Specify the color of the crop selection using SelColor1 and SelColor2
- Specify the style of crop selection grips using SetSelectionGripStyle
- Hold the Shift key to force rotation in 15 deg. increments


Rotated Crop




Perspective Fix




Example

// Disable guide lines (on image thirds)
ImageEnView1.CropTool.DrawGuides := False;

// High quality cropping
ImageEnView1.CropTool.AntialiasMode := ierBicubic;

// Enable crop mode
ImageEnView1.MouseInteractGeneral := [miCropTool];

// Enact crop (same as user clicking "Enter")
ImageEnView1.CropTool.Crop();

// Cancel crop tool (same as user clicking "Esc")
ImageEnView1.CropTool.Cancel();


Methods and Properties

General Properties
Public Property  AntialiasMode
Public Property  DrawGuides
Public Property  LockAspectRatio
Public Property  LockWidth
Public Property  LockHeight
Public Property  Mode
Public Property  Options

Selection
Public Property  BitmapPolygon
Public Property  Rotation (Same as rotating selection)
Public Property  RotatedPolygon
Public Property  ScreenPolygon
Public Property  Selected
Public Method  SetBitmapPolygon (Same as resizing selection)
Public Property  State

Command Methods
Public Method  Cancel (Same as clicking "Esc")
Public Method  Enact (Same as clicking "Enter")


See Also

- OnUserInteraction
- TImageEnView Actions