Applying Actions

Actions are processes that can be applied to the images attached to cells within the container/image viewer. LEADTOOLS supports several standard or "built-in" actions and custom or "user-defined" actions. The built-in actions LEADTOOLS supports are listed below:

Window Leveling: Maps grayscale intensities using a user defined color map (LUT).

Alpha: A window-leveling factor used when the window leveling lookup table is not linear.

Scale: Increases or decreases the size of the image in the cell.

Offset: Changes the offset of the image within the cell.

Magnifying Glass: Magnifies the image in the cell.

Stack: Scrolls the images within the cell.

Custom actions are completely controlled by the user, including any mouse movement and keystroke association. The user handles these custom actions through KeyDown, KeyUp, MouseMove, MouseDown, MouseUp or MouseWheel events.

Regardless of whether the action is built-in or custom, any action must be activated inside a container by calling the corresponding ActivateAction method for that action, for example to activate the window level action inside a container you need to call the ActivateAction method(ILEADWindowLevelAction). The ActiveActionCount property contains the number of active actions in a container.

Once the action has been activated, assign it to a mouse button using the SetMouseButtonAction method. An action can be assigned to more than one mouse button.

In addition to assigning an action to a mouse button, an action can also be assigned to a keystroke combination. To set the keystroke combination for an action, call the SetKeyboardAction method. To get the current keystroke combination associated with a specific action, call the GetKeyboardAction method.

Most "built-in" actions have container and cell level properties. The container level properties are those related to the mouse or keyboard when applying the action, whereas the cell level properties are used to apply the action with specific values to a selected cell without using the mouse or keyboard. To activate container-level proprieties update those properties and call SetAction passing CONVIEW_ACTIONLEVEL_CONTAINER in the ActionLevel parameter. To activate cell-level proprieties update those properties and call SetAction passing CONVIEW_ACTIONLEVEL_CELL in the ActionLevel parameter.

The following sections list the properties, methods and events that are used with the various actions supported by LEADTOOLS:

To use and change the container window level action, use the following:

ActivateAction Method

Cursor Property

Change Property

CircularMouseMove Property

EndColor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

StartColor Property

Use Property

WindowLevelAction property

To change the window level of a certain cell, use the following:

Center Property

FillType Property

GetAction Method

SetAction Method

Width Property

To use and change the container alpha action, use the following:

ActivateAction Method

AlphaAction property

Change Property

CircularMouseMove Property

Cursor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

Use Property

To change the alpha action of a certain cell, use the following:

Factor Property

GetAction Method

SetAction Method

To use and change the container offset action, use the following:

ActivateAction Method

Change Property

CircularMouseMove Property

Cursor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

OffsetAction Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

Use Property

To change the offset action of a certain cell, use the following:

GetAction Method

SetAction Method

XOffset property

YOffset property

To use and change the Magnify glass action, use the following:

ActivateAction Method

Appearance3D Property

BorderSize Property

CrossHair Property

Ellipse Property

GetAction Method

Height Property

MagnifyGlassAction Property

PenColor Property

SetMouseButtonAction Method

SetAction Method

Use Property

Width Property

ZoomFactor Property

To use and change the container scale action, use the following:

ActivateAction Method

ScaleAction Property

Change Property

CircularMouseMove Property

Cursor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

Use Property

To change the scale action of a certain cell, use the following:

GetAction Method

ScaleFactor property

SetAction Method

To use and change the container stack action, use the following:

ActivateAction Method

Change Property

CircularMouseMove Property

Cursor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

StackAction Property

Use Property

To change the stack action of a certain cell, use the following:

ActiveSubCell property

GetAction Method

ScrollValue property

SetAction Method

To create, use and change owner action, use the following:

ActivateAction Method

Change Property

CircularMouseMove Property

Cursor Property

GetAction Method

GetKeyboardAction Method

Key Property

Modifier Property

OwnerAction Property

SetAction Method

SetKeyboardAction Method

SetMouseButtonAction Method

Use Property

To specialize mouse and keyboard input to control owner actions, use the following:

Click event

DblClick event

KeyDown event

KeyPress event

KeyUp event

MouseDown event

MouseMove event

MouseUp event

MouseWheel event