Annotation on Form View Controls

Description

You can annotate form view controls such that a user can draw over captured images with an ink control and then save the modified image to a list.

A form view with working image capture
A form view with working image capture
Clicking the 'Annotate Image' Button lets users draw on the image.
Clicking the 'Annotate Image' Button lets users draw on the image.
The modified image can be saved to the form view and then back into the list control.
The modified image can be saved to the form view and then back into the list control.

For a video explanation on how to implement annotations watch these two videos: Part 1, Part 2.

Implementing an Annotation

  1. In the UX Builder, open the Controls page. In the Data Controls menu click [List] to add a list control to the component.

    Im
  2. In the control's properties list, in the List Properties section, click on the 'List properties' property to open the List Builder.

    Im2
  3. In the List Builder's Data Source pane select 'Static' in the Data Source Type' menu.

    Im3
  4. Click the button next to the Static data property.

    Im4
  5. In the Static Choices dialog click the 'Sample data' button in the lower left corner.

    Im5
  6. Add the 'Name and addresses' data and click OK.

    Im6
  7. In the first row of the data add a fifth field named 'Picture' and a sixth field named 'Annotation'. Your Static Choices data should look like this, click OK:

    Anon
  8. Open the List Builder's Fields pane. Highlight the Picture field and go to the Client-side section of that field's properties list. Change the 'Control type' property to 'Image'.

    Anon2
  9. Drop down to the Picture field's Image Properties section and change the 'Image Data type' property to Base64.

    Anon3
    It is important to do this before generating a template for this field
  10. Highlight the Annotation field. Change its Control type to 'Ink'.

    Anon4
  11. Open the List Builder's List Layout pane. Move the Firstname, Lastname, City, State, and Picture fields from the Available Fields list into the Columns in List section using the blue > arrow. Do not move Annotation field.

    Anon5
  12. Highlight the picture field in the 'Columns in List' section. In the Column Properties section click the button next to the "Template" property.

    Anon6
  13. The Column Template dialog will open. Erase any current code in the dialog and click on the Template Genie. Select "Display Ink Over Image".

    Anon7
  14. Select the 'Picture' field for the '' setting and the 'Annotation field for the ''setting. Click OK to close the List Builder.

    Anon8
    The size of the image as it will appear on the list control is defined here (100px by default). Also note that the image source is defined here as being base64.
  15. On the UX Controls page open the Other Controls menu. Click on [Form View] to add a form view control to the component.

    Anon9
  16. Next open the UX Controls page's Container menu and click on [Container]. From the Container Type list choose 'Editor Set'.

    Anon10
  17. Now open the UX Controls page's Defined Controls menu. Click on the Editor-Ink option to add an Ink editor inside the editor set. Name the control EDITOR_INK.

    Anon11
  18. Highlight the Form View that you defined earlier. In the Properties list click the button next to the 'Form properties' property to open the Form View Builder.

    Anon12
  19. On the Form View Builder's Data Source pane select 'List' from the 'Datasource type' dropdown. Click the button next to the "List name" property and select the list that was defined earlier, in this case list1.

    Anon13
  20. Highlight the Annotation field.

    Anon20
  21. In the properties list change the Annotation's 'Field type' to 'Ink'.

    Anon19
  22. Click the button next to the Editor set property in the Editing section.

    Anon21
  23. In the "Select Editor" dialog set the 'Editor Set' to be 'EDITORSET_1' and the 'Editor' to be the ink editor you defined, in this case EDITOR_INK. Click OK

    Anon22
  24. Open the Form View Builder's Fields pane. Highlight the Picture field.

    Anon14
  25. In the Picture field's properties list change the 'Field type' to Image.

    Anon15
  26. View the 'Image Field Properties'. Change the Data type to be 'Base64'.

    Anon16
  27. Check Allow image capture

    Anon17
  28. Check 'Allow image annotation'.

    Anon18
  29. For the 'Annotation field name' property select 'Annotation'

    Anon23
  30. Check 'Clear annotation if picture changed.

    Anon24
  31. Open the Form View Builder's 'Form Layout' pane. Click the Add item button.

    Anon25
  32. The Select Control Type dialog will open. In the 'Category' menu select 'Data Controls'. In the 'Control' menu select [Label], and in the fields list select the Firstname, Lastname, City, and State fields. Then Click OK.

    Anon26
  33. Click the 'Add item' button again.

    Anon27
  34. In the Select Control Type dialog select 'Data Controls' again in the Category menu. In the Control menu select [Image-DataBound] and in the fields list select the 'Picture' field. Click OK.

    Anon28
  35. Click the 'Add item' button once more. In the Category menu select 'Pre-defined Controls' and in the 'Control' menu select [Save Form Edits/Cancel Edits Button]. This will allow you to save information from the Form View control into the List Control. Click OK.

    Anon29
  36. Highlight the [Image-DataBound:Picture] item in the item list.

    Anon30
  37. In the Camera/Image Capture section of the properties list check 'Allow image capture'

    Anon31
  38. Set Image capture method to be 'TapOnImage'.

    Anon32
  39. In the 'Image Annotation' section check 'Allow image annotation'

    Anon33
  40. Leave the 'Annotation button HTML' text as 'Annotate Image'.

    Anon34
  41. Close the Form View Builder and run the component in Live Preview. Click on one of the List control rows to open the Form View.

    Anon35
  42. Click on the empty Picture field to add an image to the form view.

    Anon36
  43. Click the Annotate Image button to draw on the image using the Ink control.

    Anon37
  44. Save the altered image back into the List Control.

    Anon38