ImageEn, unit imageenview

TIEUserInteractionNotify


Declaration

TIEUserInteractionNotify = procedure(Sender: TObject; Event: TIEUserInteractionEvent; Info: Integer) of object;


Description

Event specifies the type of user interaction that has occured:
Value Description Info Value
ieiCropCreating User is selecting a rect for TIECropToolInteraction N/A
ieiCropSizing User is adjusting the rect of TIECropToolInteraction Grip (ordinal of TIEGrip)
ieiCropMoving User is moving the rect of TIECropToolInteraction N/A
ieiCropRotating User is rotating the rect of TIECropToolInteraction New rotation value
ieiCropEnacted TIECropToolInteraction was enacted (i.e. image was cropped) N/A
ieiCropCanceled TIECropToolInteraction was canceled N/A
ieiPaintStart User has started painting using TIEBrushToolInteraction (mouse down) N/A
ieiPainting User is painting using TIEBrushToolInteraction (mouse move) N/A
ieiPaintEnd User has completed painting using TIEBrushToolInteraction (mouse up) N/A
ieiPaintCanceled TIEBrushToolInteraction was canceled N/A
ieiCloneStart User has started cloning using TIECloneToolInteraction (mouse down) N/A
ieiCloning User is cloning using TIECloneToolInteraction (mouse move) N/A
ieiCloneEnd User has completed cloning using TIECloneToolInteraction (mouse up) N/A
ieiCloneCanceled TIECloneToolInteraction was canceled N/A
ieiRetouchStart User has started retouching using TIERetouchToolInteraction (mouse down)
ieiRetouching User is retouching using TIERetouchToolInteraction (mouse move)
ieiRetouchEnd User has completed retouching using TIERetouchToolInteraction (mouse up)
ieiRetouchCanceled TIERetouchToolInteraction was canceled
ieiRotateStart User has started rotating using TIERotateToolInteraction (mouse down) N/A
ieiRotating User is rotating using TIERotateToolInteraction (mouse move) New rotation value
ieiRotateEnd User has completed rotating using TIERotateToolInteraction (mouse up) N/A
ieiFlipped User has flipped using TIERotateToolInteraction N/A
ieiRotateCanceled TIERotateToolInteraction was canceled N/A
ieiLayerCreateStart User has started creating a layer using a mlCreate*Layers Interaction (mouse down) N/A
ieiLayerCreating User is creating a layer using a mlCreate*Layers Interaction (mouse move) New layer index
ieiLayerCreateEnacted User has completed creating a layer using a mlCreate*Layers Interaction (mouse up) New layer index
ieiLayerCreateCanceled Layer creation using a mlCreate*Layers Interaction was canceled N/A
ieiLayerPointsCreated User has started creating a layer using a mlClickCreate*Layers Interaction N/A
ieiLayerPointAdded User has added a point to a layer using a mlClickCreate*Layers or mlEditLayerPoints Interaction Index of new point
ieiLayerPointMoving User has moved a point of a layer using the mlEditLayerPoints Interaction (mouse move) Point being moved
ieiLayerPointRemoved User has removed a point from a layer using the mlEditLayerPoints Interaction Index of removed point
ieiLayerPointsCreated User has completed creating a layer using a mlClickCreate*Layers Interaction N/A
ieiLayerPointsEdited User has completed editing points of a layer using the mlEditLayerPoints Interaction N/A
ieiLayerPointsCanceled User has canceled editing points of a layer using the mlClickCreate*Layers or mlEditLayerPoints Interaction N/A
ieiMeasuringLength User is measuring a length using the miMeasureLength Interaction (mouse move) N/A
ieiMeasuringArea User is measuring an area using a miMeasure* Interaction (mouse move) N/A
ieiColorFill User has enabled the miColorFill Interaction and clicked the image to perform a flood fill Color of Fill
ieiAlphaFill User has enabled the miAlphaFill Interaction and clicked the image to perform an alpha flood fill Alpha of fill
ieiColorPickerHover User has enabled the miColorPicker Interaction and is hovering over a color TColor under the cursor
ieiColorPickerClick User has enabled the miColorPicker Interaction and clicked a color TColor of clicked pixel
ieiPDFAction User has interacted with the PDF Viewer
ieiPDFDocChanged User has added or deleted pages in the current PDF Viewer
ieiPDFFormChanged User has edited form fields in the current PDF Viewer
ieiPDFClickedLink User has clicked a link in the PDF Viewer (only called if OnClickLink is assigned)

The Info parameter may carry further detail of the event, as detailed in the table above.


Examples

procedure TfrmMain.IEView1UserInteraction(Sender: TObject; Event: TIEUserInteractionEvent; 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

- TIEUserInteraction