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:
To change the window level of a certain cell, use the following:
To use and change the container alpha action, use the following:
To change the alpha action of a certain cell, use the following:
To use and change the container offset action, use the following:
To change the offset action of a certain cell, use the following:
To use and change the Magnify glass action, use the following:
To use and change the container scale action, use the following:
To change the scale action of a certain cell, use the following:
To use and change the container stack action, use the following:
To change the stack action of a certain cell, use the following:
To create, use and change owner action, use the following:
To specialize mouse and keyboard input to control owner actions, use the following: