ImageEn, unit iexUserInteractions

TIEBrushToolInteraction.EndPainting

TIEBrushToolInteraction.EndPainting


Declaration

function StartPainting(): TRect;


Description

Complete a programmatic painting operation and enact the changes (i.e. to mimic a user painting operation with your own code).
Result is the area that was painted (in screen coordinates).

Normally, painting operations are performed by the user via miBrushTool, but it can be performed with code using:
1. Set the size and color of the brush
2. Start painting using StartPainting
3. Add extra points to the painting operation using AddToPainting (Optional)
4. Enact the painting changes using EndPainting


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Example

// Paint a red line
ImageEnView1.BrushTool.BrushColor := clRed;
ImageEnView1.BrushTool.BrushSize  := 50;
ImageEnView1.BrushTool.StartPainting( 50, 250 );              // Start at 50,250
ImageEnView1.BrushTool.AddToPainting( 200, 250 );             // Paint to 200,250
ImageEnView1.BrushTool.AddToPainting( 200, 450 );             // Paint to 200,450
ImageEnView1.BrushTool.EndPainting();                         // Enact the changes