ImageEn, unit imageenview

TImageEnView.SelectionLockAspectRatio

TImageEnView.SelectionLockAspectRatio


Declaration

property SelectionLockAspectRatio: Double;


Description

Specifies whether the selection is locked to a specific size or aspect ratio.

Value Description
-1 Aspect ratio is locked only when user press the ALT key, and is automatically calculated
-2 Same as -1, except size of selection cannot be resized to smaller than SelectionAbsWidth and SelectionAbsHeight
0 Size of the selection is fixed by the SelectionAbsWidth and SelectionAbsHeight properties
>0 Selection is locked to the specified aspect 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

Default: -1


Compatiblity Information

SelectionLockAspectRatio replaces the SelectionAspectRatio in versions of ImageEn prior to v12.0.0. Unlike the old property, SelectionLockAspectRatio uses a standard W/H ratio.

// Old Method
// Force a 4:3 landscape image
ImageEnView1.SelectionAspectRatio := 3 / 4;

// New Method
// Force a 4:3 landscape image
ImageEnView1.SelectionLockAspectRatio := 4 / 3;


Examples

// We want standard behavior (no aspect ratio locking unless user clicks Alt key)
ImageEnView1.SelectionLockAspectRatio := -1;

// We want standard behavior, except user cannot resize selection to less than 100 x 100 pixels
ImageEnView1.SelectionAbsWidth    := 100;
ImageEnView1.SelectionAbsHeight   := 100;
ImageEnView1.SelectionLockAspectRatio := -2;

// We want a fixed selection of 100 x 100 pixels
ImageEnView1.SelectionAbsWidth    := 100;
ImageEnView1.SelectionAbsHeight   := 100;
ImageEnView1.SelectionLockAspectRatio := 0;

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


See Also

 LockAspectRatio
 LockWidth
 LockHeight