ImageEn, unit iexUserInteractions

TIECropToolInteraction.LockAspectRatio

TIECropToolInteraction.LockAspectRatio


Declaration

property LockAspectRatio: Double;


Description

Allows the crop selection to be locked to a specific ratio of width/height, e.g. 1.33 for a 4:3 landscape image, 0.75 for a 3:4 portrait image, or 1.78 for 16:9 widescreen format.
If LockAspectRatio is -1, the aspect ratio is only locked when the user presses the ALT key
If LockAspectRatio is >0, ImageEn locks the selection to the specified aspect ratio

Note: By default, when dragging the side grips the aspect ratio is not enforced. Add iecoSideGripsRespectLocks to Options to force all grips to respect the ratio


Example

// We want standard behavior (No locking unless Alt key is pressed)
ImageEnView1.CropTool.LockAspectRatio := -1;

// We want a fixed aspect ratio of 4:3 (standard landscape, i.e. height is 75% of width)
ImageEnView1.CropTool.LockAspectRatio := 4 / 3;


Demo

Demo  Demos\ImageEditing\CropTool\CropTool.dpr


See Also

 Options
 SelectionLockAspectRatio
 LockHeight
 LockWidth