ImageEn, unit iexLayerMView

TImageEnLayerMView.OnGetLayerImage

TImageEnLayerMView.OnGetLayerImage


Declaration

property OnGetLayerImage: TIEImageIDRequestExEvent;


Description

Occurs whenever an image is required for a layer. The image will be displayed as the thumbnail for the layer.

ID is the Index of the layer, e.g. 0 for the background layer.
Bitmap is the image to display. It is a TIEBitmap. You will need to create it, but you do NOT need to free it as it will be automatically freed.
If you do NOT create Bitmap then the default layer image will be used.

Note:
OnGetLayerImage is called very frequently (every time the layers change) so ensure you use a fast method to fill this.
You should use a source with an alpha channel so it looks correct when the thumbnail is selected


Example

procedure TMainForm.IELayerMView1GetLayerImage(Sender: TObject; Index, ID: Integer; var Bitmap: TIEBitmap);
begin
  // For Mask layers, show a mask bitmap
  if ImageEnView1.Layers[ID].IsMask then
  begin
    Bitmap := TIEBitmap.create;
    ImageList1.GetBitmap( 2, Bitmap.VclBitmap );
  end;
end;


See Also

OnImageOut