ImageEn, unit imageenview

TImageEnView.OnUserInteraction

TImageEnView.OnUserInteraction


Declaration

property OnUserInteraction: TIEUserInteractionNotify;


Description

Occurs whenever a user interaction event occurs, such as enacting or canceling a crop.


Examples

procedure TfrmMain.IEView1UserInteraction(Sender: TObject; Event: TIELayerEvent; Info: Integer);
begin
  // Beep on crop cancellation
  if Event = ieiCropCanceled then
    MessageBeep( MB_ICONEXCLAMATION );
end;


// Use miColorPicker to set transparent parts of image

procedure TMainForm.btnSelColorClick(Sender: TObject);
begin
  // Enable color picker. Revert to previous tool after color is selected
  ImageEnView1.MouseInteractGeneral := [ miColorPicker ];
  ImageEnView1.FillTool.ResetAfterColorSelect := True;
end;

procedure TMainForm.ImageEnView1UserInteraction(Sender: TObject; Event: TIEUserInteractionEvent; Info: Integer);
var
  c: TColor;
begin
  if Event = ieiColorPickerHover then
  begin
    // Hovering over image - show color in our panel
    pnlCurrentColor.Color := TColor( Info );
  end
  else
  if Event = ieiColorPickerClick then
  begin
    // Clicked image - set this color as transparent in our image
    c := TColor( Info );
    ImageEnView1.Proc.SetTransparentColors( c, c, 0);
  end;
end;


See Also

TIECropToolInteraction
TIEBrushToolInteraction
TIERetouchToolInteraction
TIECloneToolInteraction
TIEFillToolInteraction
TIERotateToolInteraction
TIETransformToolInteraction
MouseInteractGeneral
MouseInteractLayers
OnLayerNotifyEx
TIEUserInteraction