What is the Sketch extension?
The Sketch extension caters for workflows that require freehand sketch data entry. Two specific scenarios of how the sketch extension can be used in your ArcPad project are:
- annotation of photographs that are linked to features
- capture of a signature onto a data entry form
Some scripting is required to invoke the sketch extension from an ArcPad form. The sample scripts included in this tutorial can be used as is, or you can modify them for your own needs.
The sketch extension is in fact an example of an ArcPad camera extension. This means it can also be used without scripting at all, in place of any other camera extension. To do this, after copying the Sketch.dll to your Extensions folder, launch ArcPad and go to the Camera tab of the Options dialog. Select ArcPad Sketch from the Camera drop down. This selection will mean that whenever you tap the Camera tool in ArcPad, the drawing window will be invoked in place of the photo capture page.
The sketch extension will work on Windows and Windows Mobile and with versions of ArcPad from version 7 and above, and contained in the install of ArcPad from version 10.2.
What does the Sketch extension do?
When the sketch extension is invoked, a drawing window is displayed upon which the user can draw with a stylus, finger or mouse. The drawing window can be either a blank canvas or have an existing image or photo as the background.
The drawing window includes a
- pen color chooser (top left hand corner)
- pen width chooser (top right hand corner)
- cancel button (bottom right hand corner)
- ok button (bottom left hand corner)
If the user changes the pen color or width, the new choices are remembered next time the drawing window is used. When the user taps on the color chooser, the default ArcPad color designer dialog displays. The user can select the preferred color and tap OK to change the color for sketching.
When the user taps on the pen width chooser, a drop down list will show the available widths. The user can select the preferred width from the drop down, and use this pen width immediately.
On Windows Mobile the combobox will contain the numbers 1 to 5 representing the line widths rather than a picture of the line.
When the user is satisfied with the sketch,
the OK button must be tapped to save the image and return to the feature properties dialog. If the Cancel button is tapped, the image reverts to the previous image saved.
How do you invoke the Sketch extension?
To invoke the sketch extension it must be referenced in a function that is called from an ArcPad event. The event can be associated to a form control, for example, the onclick event of an IMAGEBOX or BUTTON control. The event could also be on system object event such as the GPS position or timer.
The sketch extension is referred to in script by its code @SKT, with the following 3 parameters:
- Name (Required) - String that specifies the file name of the JPEG image.
- Quality (Optional) - A Long that specifies the quality of the JPEG image (default 75).
- hWnd (Optional). A window handle to dock the sketch, otherwise it will appear undocked.
Example of referring to the Sketch extension.
Dim extSketch
Set extSketch = Extensions("@SKT")
Call extSketch.Escape(Name, Quality, hWnd)