ImageEn, unit iexLayers

TIELayer.AspectRatioLocked

TIELayer.AspectRatioLocked


Declaration


property AspectRatioLocked: Boolean;


Description


When enabled the PreferredAspectRatio for the layer will be enforced regardless of the setting for LayersResizeAspectRatio.

Notes:
- You may want to call RestoreAspectRatio before enabling AspectRatioLocked if you want to lock to the best AR for this layer
- Dragging grips other than the corner will still allow users to skew the image. To avoid this use ShiftKeyLock

Default: False (Except for TIEAngleLayer, where default is true)


Examples


// Lock layer to the current aspect ratio
ImageEnView1.CurrentLayer.AspectRatioLocked := True;

// Force aspect ratio locking if the object prefers it
if ImageEnView1.CurrentLayer.PreferredAspectRatio <> 0 then
begin
  ImageEnView1.CurrentLayer.RestoreAspectRatio( True);
  ImageEnView1.CurrentLayer.AspectRatioLocked := True;
  ImageEnView1.Update();
end;

// Add a "Shape" layer with text
ImageEnView1.LayersAdd( ielkText, 800, 300, 400, 400 );
ImageEnView1.CurrentLayer.AspectRatioLocked := true;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderShape := iesHeart;
TIETextLayer( ImageEnView1.CurrentLayer ).Alignment := iejCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).Layout := ielCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).WordWrap := False;
TIETextLayer( ImageEnView1.CurrentLayer ).Text := 'I Heart Delphi';
TIETextLayer( ImageEnView1.CurrentLayer ).Font.Size := 42;
TIETextLayer( ImageEnView1.CurrentLayer ).TextOverflow := ieoShrink;
TIETextLayer( ImageEnView1.CurrentLayer ).HorzMargin := 0.30;
ImageEnView1.CurrentLayer.BorderColor := clBlack;
ImageEnView1.CurrentLayer.FillColor := clRed;
ImageEnView1.LayersTextRotateMode := iermBoth;
ImageEnView1.Update();