It allows you to draw traces on images. You can store only the trace made on an image, or store the image together with the annotations. This control cannot be placed inside Grids because they generate a Scroll, and when a trace is drawn on the scroll axis the event triggered will be the scroll and not the trace.
It stores the modified image along with the annotations.
&ResultImage = &AnnotationImage.GetAnnotadeImage()
It stores only the annotations made on an image.
&AnnotationsImage = &AnnotationImage.GetAnnotations()
It undoes the last trace made. The trace is taken from the moment you press on the device screen until you release it.
It redraws the last trace discarded by the previous Undo.
In both cases, when a new trace is made, the trace history changes.
A car rental company uses an application for the rental process. When the car is delivered, it is checked by both the supervisor and the client, so that both of them try to find any scratches or dents before the client takes the car out on the street. That way the supervisor will record anything that might be found.
This example will show the steps to follow to design a screen like the one shown below, using several of the methods provided by the control:
Create a Panel For Smart Devices, and drag an Attribute/Variable of Image type to the Main Table. Change the Control Type property and assign it the value "SD Image Annotations."
Enter some images that will allow you to indicate the thickness of the trace, and to delete and recover the traces made. Schedule the following events for these images.
// They configure the thickness (in dips) of the traces to be drawn on the background image.
&CarImage.TraceThickness = 1
&CarImage.TraceThickness = 3
// It undoes the last trace drawn by the user.
// It redraws the last trace discarded by the previous Undo.
Lastly, add some images with the colors available for the trace. Program the Tap events for each of the colors. This way you can change the color of the trace at runtime.
// They configure the different colors for the traces.
&CarImage.TraceColor = rgb(0,0,0)
&CarImage.TraceColor = rgb(249,104,104)
&CarImage.TraceColor = rgb(94,169,231)
&CarImage.TraceColor = rgb(164,220,141)
&CarImage.TraceColor = rgb(255,217,87)
The application will then be programmed to meet the proposed scenario:
SDImageAnnotation download XPZ
Platform: Smart Devices(iOS)
Trace Thickness property
Trace Color property
GeneXus 16 upgrade 9
GeneXus 16 Help