InkPicture control

An InkPicture control collects pen input ("ink") on a Tablet PC and layers it on a picture. It is used to collect ink annotations to a picture or signatures. It has no handwriting recognition capability.

Using with animation features

InkPicture controls may not paint correctly when you use animation features.

Properties

InkPicture property

Datatype

Description

AutoErase

Boolean

Specifies whether the auto erase feature available on some styluses is turned on. Values are:

TRUE -- AutoErase is turned on.

FALSE -- AutoErase is turned off (default).

BackColor

Long

Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference.

Border

Boolean

Specifies whether the control has a border. Values are:

TRUE -- Control has a border.

FALSE -- Control does not have a border.

BorderStyle

BorderStyle (enumerated)

Specifies the border style of the control. Values are:

StyleBox!

StyleLowered!

StyleRaised!

StyleShadowBox!

BringToTop

Boolean

Specifies whether PowerBuilder moves the control to the top of the front-to-back order.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

CollectionMode

InkCollectionMode (enumerated)

Specifies whether ink only, gestures only, or ink and gestures are collected. Values are:

GestureOnly! -- Only gestures are collected.

InkOnly! -- Only ink is collected (default).

InkAndGesture! -- Ink and gestures are collected.

DragAuto

Boolean

Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are:

TRUE -- When the control is clicked, the control is automatically in Drag mode.

FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function.

DragIcon

String

Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control.

When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays.

DynamicRendering

Boolean

Specifies whether the ink is rendered (displayed in the control) as it is drawn. The default is true.

EditMode

InkPicEditMode

Specifies whether the editing mode of the control is set for drawing ink, editing ink, or deleting ink. Values are:

InkPicDeleteMode! -- Ink is deleted.

InkPicInkMode! -- Ink can be drawn (default).

InkPicSelectMode! -- Ink is selected for editing.

Enabled

Boolean

Specifies whether the control is enabled (can be selected). Values are:

TRUE -- Control can be clicked.

FALSE -- Control cannot be clicked.

EraserMode

Integer

Specifies whether ink is removed by stroke or point. Values are:

0 -- Ink is removed by stroke (default).

1 -- Ink is removed by point.

EraserWidth

Integer

Specifies the width of the eraser pen tip in pixels. The default is 212 pixels.

Height

Integer

Specifies the height of the control, in PowerBuilder units.

HighContrastInk

Boolean

Specifies whether ink is rendered in a single color when the system is in high contrast mode and draws the selection rectangle and handles in high contrast. Values are:

TRUE -- Ink is rendered in a single color in high contrast mode (default).

FALSE -- Ink is not rendered in a single color in high contrast mode.

IgnorePressure

Boolean

A drawing attribute that specifies whether the drawn ink gets wider as the pressure of the pen tip on the tablet surface increases. Values are:

TRUE -- Pressure from the pen tip is ignored.

FALSE -- The width of the ink increases with the pressure of the pen tip (default).

InkAntiAliased

Boolean

A drawing attribute that specifies whether the foreground and background colors along the edge of the drawn ink are blended (antialiased) to make the stroke smoother and sharper. Values are:

TRUE -- The ink stroke appears smoother and sharper (default).

FALSE -- The ink stroke is not antialiased.

InkColor

Long

A drawing attribute that specifies the current ink color. The default color is black.

InkEnabled

Boolean

Specifies whether the InkPicture control collects pen input. Values are:

TRUE -- The control collects pen input (default).

FALSE -- The control does not collect pen input and no pen-related events fire.

InkFileName

String

Specifies the name of the file that the ink was loaded from.

InkHeight

Integer

A drawing attribute that specifies the height of the side of the rectangular pen tip in pixels. The default is 1.

InkTransparency

Integer

A drawing attribute that specifies the transparency of drawn ink. The range of values is from 0 for totally opaque (the default) to 255 for totally transparent.

InkWidth

Integer

A drawing attribute that specifies the width of the pen in pixels. The default is 53. If the IgnorePressure property is not set, the actual width varies between .5 times the value of the Width property for minimum pressure and 1.5 times its value for maximum pressure.

MarginX

Integer

Specifies the x-axis margin around the control in PowerBuilder units. The default value is 0.

MarginY

Integer

Specifies the y-axis margin around the control in PowerBuilder units. The default value is 0.

PenTip

InkPenTip (enumerated)

A drawing attribute that specifies whether the pen tip is round or rectangular. Values are:

PenTipBall! -- The pen tip is round (default).

PenTipRectangle! -- The pen tip is rectangular.

PictureFileName

String

Specifies the name of a file that contains the picture for the control. The default is an empty string. Supported formats are BMP, GIF, JPEG, PNG, and TIF.

PictureSizeMode

DisplaySizeMode

Specifies how the picture is displayed in the control. Values are:

InkPicAutoSize! -- The control is resized to display the entire picture.

InkPicCentered! -- The picture is centered in the control.

InkPicNormal! -- The picture is displayed in the upper-left corner of the control and any part of the picture that does not fit in the control is clipped (default).

InkPicStretched! -- The picture is stretched to fill the control.

Pointer

String

Specifies the name of the stock pointer or the file containing the pointer used for the control.

PowerTipText

String

Specifies a PowerTip for the control.

Status

InkPicStatus

Read-only property available at runtime that provides the current status of the control so that the user does not need to monitor the Stroke event. Values are CollectingInk! and Idle!.

TabOrder

Integer

Specifies the tab value of the control within the window (0 means the user cannot tab to the control.

Tag

String

Specifies the tag value assigned to the control.

Visible

Boolean

Specifies whether the control is visible. Values are:

TRUE -- Control is visible (default).

FALSE -- Control is not visible.

Width

Integer

Specifies the width of the control, in PowerBuilder units.

X

Integer

Specifies the X position (the distance from the left edge of the window), in PowerBuilder units.

Y

Integer

Specifies the Y position (the distance from the top of the window), in PowerBuilder units.


Events

InkPicture event

Occurs

Clicked

When the left mouse button is clicked in the control

Constructor

When the object is created, immediately before the Open event occurs in the window

Destructor

When the object is destroyed, immediately after the Close event occurs in the window

DragDrop

When a dragged control is dropped on the control

DragEnter

When a dragged control enters the control

DragLeave

When a dragged control leaves the control

DragWithin

When a dragged control is within the control

Gesture

When a gesture has occurred

GetFocus

Just before the control receives focus (before it is selected and becomes active)

Help

When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control

LoseFocus

When the control loses focus (becomes inactive)

Other

When a Windows message occurs that is not a PowerBuilder event

RButtonDown

When the right mouse button is pressed on the control

SelectionChanged

When an item in the control is selected

SelectionChanging

When the selection is changing. Return 1 to prevent the selection from changing or 0 to allow it

SizeChanged

When the control has been resized

Stroke

When a stroke has occurred


Functions

InkPicture function

Datatype returned

Description

ClassName

String

Returns the name of the control.

Drag

Integer

Starts or ends the dragging of a InkEdit item.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetParent

PowerObject

Returns a reference to the name of the parent object.

Hide

Integer

Hides the specified InkEdit item.

LoadInk

Integer

Loads ink from a file or blob.

LoadPicture

Integer

Loads a picture from a file or blob.

Move

Integer

Moves a control or object to a specified location.

PointerX

Integer

Determines the distance from the left edge of an object to the pointer location.

PointerY

Integer

Determines the distance from the top edge of an object to the pointer location.

PostEvent

Boolean

Adds the event to the end of the event queue of an object.

Print

Integer

Includes this object in a print job. Only the part visible on the screen is printed.

ResetInk

Integer

Clears ink from the control.

ResetPicture

Integer

Clears a picture from the control.

Resize

Integer

Resizes a control to the specified dimensions.

Save

Integer

Saves a picture and optionally any overlay ink to a file or blob in one of the following formats: bitmap, JPEG, GIF, TIF, or PNG.

SaveInk

Integer

Saves ink to a file or blob in one of the following formats: Ink Serialized Format (ISF), GIF, Base-64 encoded ISF, or Base-64 encoded GIF.

SetFocus

Integer

Sets focus for a specified object or control.

SetPosition

Integer

Sets the position of the InkEdit control in the front-to-back order within a window.

SetRedraw

Integer

Controls the automatic redraw of an object after its properties have changed.

Show

Integer

Makes an object or control visible if it is hidden. If the object is already visible, Show brings it to the top.

TriggerEvent

Integer

Triggers a specified event in the control and executes the script for the event.

TypeOf

Object

Returns the type of the control.