ImageEn, unit imageenview

TImageEnView.BrushTool

TImageEnView.BrushTool


Declaration


property BrushTool: TIEBrushToolInteraction;


Description


Provides access to the methods and properties of the TIEBrushToolInteraction class, which is used when MouseInteractGeneral is miBrushTool.

This tool allows the user to paint onto the image with a variety of brushes.

Note: You can hold down the shift key to snap the brush to axes




Example


// Enable painting with a circular spray can brush
ImageEnView1.BrushTool.BrushShape := iecsCircle;
ImageEnView1.BrushTool.BrushFill := iebfSpray;
ImageEnView1.BrushTool.BrushSize := 50;
ImageEnView1.BrushTool.BrushColor := clRed;
ImageEnView1.MouseInteractGeneral := [ miBrushTool ];

// Enable painting with a red/yellow gradient
ImageEnView1.BrushTool.BrushShape := iecsRectangle;
ImageEnView1.BrushTool.BrushFill := iebfGradient;
ImageEnView1.BrushTool.BrushSize := 50;
ImageEnView1.BrushTool.BrushColor := clRed;
ImageEnView1.BrushTool.BrushColor2 := clYellow;
ImageEnView1.MouseInteractGeneral := [ miBrushTool ];

// Set cursor as a square eraser
ImageEnView1.BrushTool.BrushFill := iebfEraser;
ImageEnView1.BrushTool.EraserOpacity := 1.0;
ImageEnView1.BrushTool.BrushShape := iecsRectangle;
ImageEnView1.MouseInteractGeneral := [ miBrushTool ];

// Enable painting with a custom brush
ImageEnView1.BrushTool.BrushImage.Read( 'Golden-Brush.png' );
ImageEnView1.BrushTool.BrushFill := iebfImage;
ImageEnView1.BrushTool.BrushShape := iecsRectangle;
ImageEnView1.MouseInteractGeneral := [ miBrushTool ];




Demo


  Demos\ImageEditing\BrushTool\PaintBrush.dpr



Example


// Enable Clone mode
ImageEnView1.MouseInteractGeneral := [miBrushTool];

// Cancel Clone tool (same as user clicking "Esc") so user will need to click again to select a clone source
ImageEnView1.BrushTool.Cancel();


See Also


- KeyboardShortcuts