ImageEn, unit iexLayers

TIEShapeLayer.Shape

TIEShapeLayer.Shape


Declaration


property Shape: TIEShape;


Description


The shape displayed by the layer. Over sixty shapes are available.

The style of some shapes can be modified using ShapeModifier

Note: The default shape for new layers is specified by DefaultLayerShape (defaulting to iesEllipse).


Examples


// Append a Star layer
ImageEnView1.LayersAdd( ielkShape );
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesStar5;
TIEShapeLayer( ImageEnView1.CurrentLayer ).AspectRatioLocked := True;
ImageEnView1.CurrentLayer.FillColor := clRed;
ImageEnView1.Update();



// Explosion Shape
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesExplosion;



// Triangle Shape
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesTriangle;



// Arrow Shape
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesShootingArrowSW;



// Ellipse Shape
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesEllipse;



// Lightning Shape
TIEShapeLayer( ImageEnView1.CurrentLayer ).Shape := iesLightningLeft;



// Allow user to change the shape using the mouse wheel
procedure Tfmain.ImageEnView1MouseWheel(Sender: TObject; Shift: TShiftState;
    WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
var
  lyr: TIEShapeLayer;
begin
  if ( ImageEnView1.LayersCurrent > 0 ) and ( ImageEnView1.CurrentLayer.Kind = ielkShape ) then
  begin
    lyr := TIEShapeLayer( ImageEnView1.CurrentLayer );
    if WheelDelta < 0 then
    begin
      if lyr.Shape = High( TIEShape ) then
        lyr.Shape := Low( TIEShape )
      else
        lyr.Shape := TIEShape( ord( lyr.Shape ) + 1 );
    end
    else
    begin
      if lyr.Shape = Low( TIEShape ) then
        lyr.Shape := High( TIEShape )
      else
        lyr.Shape := TIEShape( ord( lyr.Shape ) - 1 );
    end;
    ImageEnView1.Update();
    Handled := True;
  end;
end;


See Also


- ShapeModifier