ImageEn, unit iexUserInteractions

TIECropToolInteraction.LockWidth

TIECropToolInteraction.LockWidth


Declaration

property LockWidth: Integer;


Description

Allows the width of the crop selection to be locked to a specific size. e.g. 200 pixels wide.

Note:
Values refer to bitmap pixels, not a screen dimension
Can be used independently of LockHeight
if iecoSizeLocksAreMinimums is specified in Options, then this value is a minimum only
Has no effect if LockAspectRatio > 0 (unless iecoSizeLocksAreMinimums is used)


Example

// we want standard behavior
ImageEnView1.CropTool.LockWidth  := 0;
ImageEnView1.CropTool.LockHeight := 0;

// Lock the width to 500 pixels (but height can be changed)
ImageEnView1.CropTool.LockAspectRatio := 0;
ImageEnView1.CropTool.LockWidth  := 500;
ImageEnView1.CropTool.LockHeight := 0;

// Lock width and height to half the image size
ImageEnView1.CropTool.LockAspectRatio := 0;
ImageEnView1.CropTool.LockWidth  := ImageEnView1.IEBitmap.Width div 2;
ImageEnView1.CropTool.LockHeight := ImageEnView1.IEBitmap.Height div 2;

// Do not allow a selection smaller than 100x100 pixels
ImageEnView1.CropTool.Options := [iecoSizeLocksAreMinimums];
ImageEnView1.CropTool.LockWidth  := 100;
ImageEnView1.CropTool.LockHeight := 100;


Demo

Demo  Demos\ImageEditing\CropTool\CropTool.dpr


See Also

LockHeight
LockAspectRatio
Options
SelectionAbsWidth