ImageEn, unit imageenview

TImageEnView.OnSelectionChange

TImageEnView.OnSelectionChange


Declaration

property OnSelectionChange: TNotifyEvent;


Description

Occurs whenever the user finishes a change of the current selection.
Methods such as AddSelPoint or Select do not call the OnSelectionChange event.


Example 1

// Real time copy of user selected region to ImageEnView2 component
ImageEnView2.Clear;
ImageEnView2.CopyFromPolygon(ImageEnView2.IEBitmap.VclBitmap, ImageEnView2.PolySelPoints^, ImageEnView2.PolySelCount, Point(0, 0));

// An enhancement of above example: Display the current user selection as zoomed in ImageEnView2
ImageEnView2.Clear;
ImageEnView2.CopyFromPolygon(ImageEnView2.IEBitmap.VclBitmap, ImageEnView2.PolySelPoints^, ImageEnView2.PolySelCount, Point(0, 0));
ImageEnView2.Zoom := 200;


Example 2

procedure Tfmain.ImageEnView1LayerSelectionChange(Sender: TObject);
var
  bmp: TIEBitmap;
begin
  // Show a preview in ImageEnView2 of the layer selected in ImageEnView1
  bmp := ImageEnView2.IEBitmap;
  ImageEnView1.CurrentLayer.CopyToBitmap( bmp, ImageEnView2.IdealImageWidth, ImageEnView2.IdealImageWidth );
  ImageEnView2.Update();
end;