TManipulatedArea tool class

Parent Previous Next

Tool Identifier: atManipulatedArea
Inherits from: TPaster

Tool description:
Title: Manipulated area
Draw methods: [dmCommand]
Capabilities: [caSelectable, caMovable, caSizable]
Connectivity hotspots: Not connectable
Accepts text: No

The TManipulatedArea tool class is applied when a manipulator targets an image area pointed out by the selector. ImagePainter then makes a copy of the selected area, pastes it into the image and runs the manipulation on it.

A manipulated area object has two modes, indicated by the SnapToArea property. When false the object  gets independent of the area on which is was first applied, meaning that when the object is later resized or moved it will keep its content unchanged. When true the object refreshes its content from the underlying area whenever necessary. This has the effect that the object is not stretchable, but will be reproduced in a 1:1 relationship with the underlying area.

When SnaptToArea is true, any changes to the object itself or to some of the objects that are in touch with it, will cause a rerun of its manipulators. As the speed of such actions are unpredictable,  a manipulated area object will not produce live update when moved or resized with the mouse, but will show only a simple outline as the mouse moves.

You may control the modes manually, by responding to the ckAreaManip flag in an OnChangeObject event handler. This flag is set whenever there is a potential need for a manipulator to refresh its content. If you in the event handler decide to treat the object in a SnapToArea fashion, call the RefreshContent method:

TForm1.ImagePainter1ChangeObject(Sender : TObject; Figure : TFigure; ChangeKind : TChangeKind);
begin
    if ChangeKind = ckManipArea then
   with Figure as TManipulatedArea do
   begin
         RefreshContent;
   end;
end;

RefreshContent is called implicitly when SnapToArea is true.

Properties
Methods