PtImageArea

An area for viewing an image

Class hierarchy:

PtWidgetPtBasicPtContainerPtImageArea

For more information, see the diagram of the widget hierarchy.

PhAB icon:

PtImageArea button in PhAB

Public header:

<photon/PtImageArea.h>

Description:

PtImageArea is an area in which you can display an image. You can select an area, zoom in and out, and scroll if the image is too large to fit in the area. You can optionally display a grid when you've zoomed in past a specified amount.


Note: PtImageArea() can not handle alpha images.

New resources:

Resource C type Pt type Default
Pt_ARG_IMAGEAREA_FLAGS short Flag 0
Pt_ARG_IMAGEAREA_GRID_COLOR PgColor_t Scalar Pg_BLACK
Pt_ARG_IMAGEAREA_GRID_THRESHOLD long Scalar 0
Pt_ARG_IMAGEAREA_IMAGE PhImage_t * Image NULL
Pt_ARG_IMAGEAREA_LEFT short Scalar 0
Pt_ARG_IMAGEAREA_SELECTION PhRect_t Struct 0, 0, 0, 0
Pt_ARG_IMAGEAREA_TOP short Scalar 0
Pt_ARG_IMAGEAREA_ZOOM long Scalar 0
Pt_CB_IMAGEAREA_DRAG PtCallback_t * Link NULL
Pt_CB_IMAGEAREA_MOVEMENT PtCallback_t * Link NULL
Pt_CB_IMAGEAREA_SCROLLED PtCallback_t * Link NULL
Pt_CB_IMAGEAREA_SELECTION PtCallback_t * Link NULL

Pt_ARG_IMAGEAREA_FLAGS

C type Pt type Default
short Flag 0

Flags that control the behavior of the image area:

Pt_IMAGEAREA_AUTOSCALE
Automatically scale the image to fit the size of the widget.
Pt_IMAGEAREA_ENABLE_SELECTION
Allow the user to select part of the image.
Pt_IMAGEAREA_EDITABLE_SELECTION
Allow the user to modify a selection.

Pt_ARG_IMAGEAREA_GRID_COLOR

C type Pt type Default
PgColor_t Scalar Pg_BLACK

The color of the grid, if displayed. See PgColor_t in the Photon Library Reference.

Pt_ARG_IMAGEAREA_GRID_THRESHOLD

C type Pt type Default
long Scalar 0

The grid threshold, expressed as a fixed-point 16.16 number. If the zooming factor (Pt_ARG_IMAGEAREA_ZOOM) is greater than this threshold, the grid is displayed.

Pt_ARG_IMAGEAREA_IMAGE

C type Pt type Default
PhImage_t * Image NULL

A pointer to a PhImage_t structure (see the Photon Library Reference) that defines the image to be displayed in the image area.

Pt_ARG_IMAGEAREA_LEFT

C type Pt type Default
short Scalar 0

The coordinate, in image pixels, of the left side of the image viewport. This only applies when the image is larger than the widget.

Pt_ARG_IMAGEAREA_SELECTION

C type Pt type Default
PhRect_t Struct 0, 0, 0, 0

A PhRect_t structure (see the Photon Library Reference) that contains the selected area of the image, in image coordinates (pixels).

Pt_ARG_IMAGEAREA_TOP

C type Pt type Default
short Scalar 0

The coordinate, in image pixels, of the top side of the image viewport. This only applies when the image is larger than the widget.

Pt_ARG_IMAGEAREA_ZOOM

C type Pt type Default
long Scalar 0

The zooming factor, expressed as a fixed-point 16.16 number.

Pt_CB_IMAGEAREA_DRAG

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the image area is dragged.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_IMAGEAREA_DRAG
reason_subtype
One of:
event
A pointer to a PhEvent_t structure that describes the event that caused the callback to be invoked.
cbdata
A pointer to a PtImageAreaCallback_t structure that contains at least the following members:

These callbacks should return Pt_CONTINUE.

Pt_CB_IMAGEAREA_MOVEMENT

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the mouse cursor is moved over the image area.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_IMAGEAREA_MOVEMENT
reason_subtype
0 (not used).
event
A pointer to a PhEvent_t structure that describes the event that caused the callback to be invoked.
cbdata
A pointer to a PtImageAreaCallback_t structure that contains at least the following members:

These callbacks should return Pt_CONTINUE.

Pt_CB_IMAGEAREA_SCROLLED

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the image area is scrolled.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_IMAGEAREA_SCROLLED
reason_subtype
The direction in which the image area scrolled:
event
A pointer to a PhEvent_t structure that describes the event that caused the callback to be invoked.
cbdata
A pointer to a PtImageAreaCallback_t structure that contains at least the following members:

These callbacks should return Pt_CONTINUE.

Pt_CB_IMAGEAREA_SELECTION

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the image area is selected.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_IMAGEAREA_SELECTION
reason_subtype
One of:
event
A pointer to a PhEvent_t structure that describes the event that caused the callback to be invoked.
cbdata
A pointer to a PtImageAreaCallback_t structure that contains at least the following members:

These callbacks should return Pt_CONTINUE.

Inherited resources:

If the widget modifies an inherited resource, the “Default override” column indicates the new value. This modification affects any subclasses of the widget.

Resource Inherited from Default override
Pt_ARG_ANCHOR_FLAGS PtWidget
Pt_ARG_ANCHOR_OFFSETS PtWidget
Pt_ARG_AREA PtWidget
Pt_ARG_BASIC_FLAGS PtBasic
Pt_ARG_BEVEL_CONTRAST PtBasic
Pt_ARG_BEVEL_COLOR PtBasic
Pt_ARG_BEVEL_WIDTH PtWidget 0
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_COLOR PtBasic
Pt_ARG_CONTAINER_FLAGS PtContainer
Pt_ARG_CONTRAST PtBasic
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_OVERRIDE PtContainer
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DARK_BEVEL_COLOR PtBasic
Pt_ARG_DARK_FILL_COLOR PtBasic
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget
Pt_ARG_EFLAGS PtWidget
Pt_ARG_EXTENT PtWidget
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_LAYOUT_INFO PtContainer
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget
Pt_ARG_GRID_LAYOUT_DATA PtWidget
Pt_ARG_GRID_LAYOUT_INFO PtContainer
Pt_ARG_HEIGHT PtWidget
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_HORIZONTAL_ALIGNMENT PtLabel
Pt_ARG_INLINE_COLOR PtBasic
Pt_ARG_LAYOUT_DATA PtWidget
Pt_ARG_LAYOUT_INFO PtContainer
Pt_ARG_LAYOUT_TYPE PtContainer
Pt_ARG_LIGHT_BEVEL_COLOR PtBasic
Pt_ARG_LIGHT_FILL_COLOR PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic
Pt_ARG_MARGIN_WIDTH PtBasic
Pt_ARG_MAXIMUM_DIM PtWidget
Pt_ARG_MINIMUM_DIM PtWidget
Pt_ARG_OUTLINE_COLOR PtBasic
Pt_ARG_POINTER PtWidget
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_ROW_LAYOUT_DATA PtWidget
Pt_ARG_ROW_LAYOUT_INFO PtContainer
Pt_ARG_SCROLLBAR_X_DISPLAY PtScrollArea
Pt_ARG_SCROLLBAR_X_HEIGHT PtScrollArea
Pt_ARG_SCROLLBAR_Y_DISPLAY PtScrollArea
Pt_ARG_SCROLLBAR_Y_WIDTH PtScrollArea
Pt_ARG_TITLE PtContainer
Pt_ARG_TITLE_FONT PtContainer
Pt_ARG_TEXT_FONT PtLabel
Pt_ARG_TEXT_STRING PtLabel Insufficient Memory
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_ARG_VERTICAL_ALIGNMENT PtLabel
Pt_ARG_WIDTH PtWidget
Pt_CB_ACTIVATE PtBasic
Pt_CB_ARM PtBasic
Pt_CB_BALLOONS PtContainer
Pt_CB_BLOCKED PtWidget
Pt_CB_CHILD_ADDED_REMOVED PtContainer
Pt_CB_CHILD_GETTING_FOCUS PtContainer
Pt_CB_CHILD_LOSING_FOCUS PtContainer
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_DND PtWidget
Pt_CB_FILTER PtWidget
Pt_CB_GOT_FOCUS PtBasic
Pt_CB_HOTKEY PtWidget
Pt_CB_IS_DESTROYED PtWidget
Pt_CB_LAYOUT PtContainer
Pt_CB_LOST_FOCUS PtBasic
Pt_CB_MENU PtBasic
Pt_CB_OUTBOUND PtWidget
Pt_CB_RAW PtWidget
Pt_CB_REALIZED PtWidget
Pt_CB_REPEAT PtBasic
Pt_CB_RESIZE PtContainer
Pt_CB_UNREALIZED PtWidget