ImageEn, unit ieview

TImageEnView.OnViewChange

TImageEnView.OnViewChange


Declaration

property OnViewChange: TIEViewChangeEvent;


Description

Notifies of changes to Zoom, ViewX or ViewY.


Example

// Assign this event to ImageEnView1 and ImageEnView2 to synchronize the view
procedure TForm1.ImageEnView1ViewChange(Sender: TObject; Change: Integer);
var
  Dest : TImageEnView;
begin
  if fUpdatingView then
    exit;

  if Sender = ImageEnView2 then
    Dest := ImageEnView1
  else
    Dest := ImageEnView2;

  fUpdatingView := True;
  Dest.LockUpdate();
  try
    Dest.Zoom := TImageEnView( Sender ).Zoom;
    Dest.SetViewXY( TImageEnView( Sender ).ViewX, TImageEnView( Sender ).ViewY );
  finally
    Dest.UnlockUpdate();
    fUpdatingView := False;
  end;
end;