ImageEn, unit iexUserInteractions

TIEPenOptions


Declaration

TIEPenOptions = class;


Description

TImageEnView supports pen/tablet devices for drawing with pressure sensitivity.
This class controls the effects of pen pressure. By default, pen pressure adjusts the opacity (reduces the transparency) of the painting, and pressing the Alt key will simultaneously adjust the brush size.
Holding down the alternative button on the pen will temporarily switch to eraser mode (BrushFill=iebfEraser).

Note: Pointer support requires Delphi 10.3 Rio or newer

Defaults:
BrushSizeEnabled: enAuto (Alt key enables it)
BrushSizeStrength: 0.75
OpacityEnabled: enTrue
OpacityStrength: 0.9


Keyboard Shortcuts

The Alt key will adjust the brush size if BrushSizeEnabled is enAuto (default)
The Ctrl key will adjust the brush opacity if OpacityEnabled is enAuto (default is enTrue)


Demo

Demo  Demos\Other\PointerEvent\PointerEvent.dpr


Examples

// Brush size is affected by pressure of pen
ImageEnView1.BrushTool.PenEffects.BrushSizeEnabled := enTrue;

// Brush size is affected by pressure of pen only when Alt key is pressed
ImageEnView1.BrushTool.PenEffects.BrushSizeEnabled := enAuto;

// Pressure of pen has no effect on brush size
ImageEnView1.BrushTool.PenEffects.BrushSizeEnabled := enFalse;

// Brush opacity is affected by pressure of pen
ImageEnView1.BrushTool.PenEffects.OpacityEnabled := enTrue;

// Brush opacity is affected by pressure of pen only when Ctrl key is pressed
ImageEnView1.BrushTool.PenEffects.OpacityEnabled := enAuto;

// Pressure of pen has no effect on brush opacity
ImageEnView1.BrushTool.PenEffects.OpacityEnabled := enFalse;


Methods and Properties

Public Property  BrushSizeEnabled
Public Property  BrushSizeStrength
Public Property  OpacityEnabled
Public Property  OpacityStrength


See Also

OnPointer
OnPointerEx
PointerDeviceCount