ImageEn, unit imageenview

TIELayerMoveSizeEvent

TIELayerMoveSizeEvent


Declaration


TIELayerMoveSizeEvent = procedure(Sender: TObject; layer: integer; event: TIELayerEvent; var PosX, PosY, Width, Height: Double) of object;


Description


Value Description
layer The layer index that is moved or resized.
event The event type (will be ielMoving, ielResizing or ielCreating).
PosX, PosY The new left and top position of the layer
Width, Height The new width and height of the layer



Example


// Force all layers to be created at 200 x 200
procedure TfrmMain.ImageEnView1MoveSizeLayer(Sender: TObject; layer: integer; event: TIELayerEvent; var PosX, PosY, Width, Height: Double);
begin
  if event = ielCreating then
  begin
    Width := 200;
    Height := 200;
  end;
end;

// Force all layers to be centered on the image horizon
procedure TfMain.ImageEnView1MoveSizeLayer(Sender: TObject; layer: integer; event: TIELayerEvent; var PosX, PosY, Width, Height: Double);
begin
  PosY := ( ImageEnView1.Layers[0].Height - Height ) / 2;
end;