ImageEn, unit iexUserInteractions

TIECloneToolInteraction.AddToCloning

TIECloneToolInteraction.AddToCloning


Declaration

function AddToCloning(BmpX, BmpY: Integer): boolean;


Description

Add extra destination points to a programmatic cloning operation (i.e. to mimic a user cloning operation with your own code).

Normally, cloning operations are performed by the user via miCloneTool, but it can be performed with code using:
1. Set the offset of the clone source
2. Start cloning using StartCloning
3. Add extra points to the cloning operation using AddToCloning (Optional)
4. Enact the cloning changes using EndCloning


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Example

// Clone an area of the image from 200 pixels above
ImageEnView1.CloneTool.SourceOffset := Point( 0, -200 );     // Set source as 200 pixels above the destination
ImageEnView1.CloneTool.StartCloning( 50, 250 );              // Start at 50,250
ImageEnView1.CloneTool.AddToCloning( 200, 250 );             // Clone to 200,250
ImageEnView1.CloneTool.AddToCloning( 200, 450 );             // Clone to 200,450
ImageEnView1.CloneTool.EndCloning();                         // Enact the changes

// This is the same as using:
ImageEnView1.CloneTool.SourcePoint := Point( 50, 50 );       // Source is 50,50
ImageEnView1.CloneTool.StartCloning( 50, 250 );              // Start at 50,250
ImageEnView1.CloneTool.AddToCloning( 200, 250 );             // Clone to 200,250
ImageEnView1.CloneTool.AddToCloning( 200, 450 );             // Clone to 200,450
ImageEnView1.CloneTool.EndCloning();                         // Enact the changes