pocket programs

Home
Products
Download
Licences
Support
Contact
DateTimePicker
MonthCal
Trackbar
Up-Down
Keypad
Sketch
-Methods
-Styles
-Constants
-Example
Progressbar

Buy-Now
Support
Contact

Sketch and Signature Controls

PP Controls provides a sketch control. It is ideal for signature capture. The width of the pen can be specified as well as the pen colour. The sketch control can load and save .bmp files which are compatible with windows CE and PC’s.


Sketch - Methods & Properties

NewSketch

Long hWnd = PPCtrl.NewSketch(hWnd, dwStyle)

Creates a new sketch control and returns the handle of the new control.

hWnd hWnd of parent form (or frame) or placeholder (hWnd)
DwStyle Specifies the style of the window being created.
If the style PC_PLACEHOLDER is specified, then hWnd refers to the control to be used as a as placeholder. The new sketch control will be placed on the form at the same location as this control, with the same size and font. The place-holder control is then hidden. Note: If PC_PLACEHOLDER style is not given, then hWnd specifies the parent window for the new control. The new control is positioned according to the current values of PPCtrl.Left, PPCtrl.Top, PPCtrl.Width and PPCtrl.Height. The font of the parent window is used.
PB1 = PPCtrl.NewSketch(Text1.hWnd, PC_PLACEHOLDER) PB2 = PPCtrl.NewSketch(hwnd, WS_BORDER)

Filename

PPCtrl.Filename(hWnd) = str

Sets the filename for load and save operations for the sketch control specified by hWnd.

PPCtrl.Filename(sk1) = “My Documents\Signature.bmp”

Load

long = PPCtrl.Load(hWnd)

Loads the bitmap file specified by PPCtrl.FileName in to the sketch control specified by hWnd. An error message will be displayed if the file cannot be opened. Returns true (1) if successful, otherwise false (0).

Ret = PPCtrl.Load(Sk1)

Save

long = PPCtrl.Save(hWnd)

Saves the contents of the sketch control specified by hWnd in the bitmap file specified by PPCtrl.FileName. An error message will be displayed if the file cannot be opened. Returns true (1) if successful, otherwise false (0).

Ret = PPCtrl.Save(Sk1)

PenColor

PPCtrl.PenColor(hWNd) = RGB value

Sets the pen color for future drawing on the sketch control specified by hWnd.

PPCtrl.PenColor(Sk1)=RGB(red,green,blue) PPCtrl.PenColor(Sk1)=RGB(0,0,0) ‘ black PPCtrl.PenColor(Sk1)=RGB(255,255,255) ‘ white

PenWidth

PPCtrl.PenWidth(hWnd) = int

Sets pen width for future drawing on the sketch control specified by hWnd. Pen width can be a value from 1 to 6 inclusive.

PPCtrl.PenWidth(SK1)=3

Erase

PPCtrl.Erase(hWnd)

Erases the contents of the sketch control specified by hWnd.

PPCtrl.Erase(Sk1)

Sketch – Styles

None


Sketch - Constants

None


Sketch - Example

Dim PPCtrl As Object Set PPCtrl = CreateObject("PPControl.Controls") Sketch = PPCtrl.NewSketch(Text16.hWnd, PC_PLACEHOLDER + WS_BORDER) PPCtrl.PenWidth(Sketch) = 2 PPCtrl.Filename(Sketch) = "\My Documents\Sketch.bmp" PPCtrl.Load (Sketch) PPCtrl.PenColor(Sketch)=RBG(0,255,0)
Private Sub Command6_Click() PPCtrl.Save Sketch PPCtrl.Erase Sketch End Sub