End users can create a mark using the ART toolbar, or your application can create them directly by calling ART functions. This section describes how to create marks with user interaction through the ART toolbar.
When a button is selected from the toolbar, ART goes into "edit mode", where the mouse is used to place and size the mark. The sequence of events depends on whether the mark is one of the types that contains text or not:
Mark does not contain text:
- User drags a rectangle on the image.
- Mark is placed and sized on the image, and is selected.
- Control returns to the application.
Mark contains text:
- User drags a rectangle on the image.
- Mark is placed and sized on the image, and is placed in text-edit mode.
- Blinking "I-Beam" insertion point is placed in the mark.
- User types text into the mark, as desired.
- User clicks the mouse-button. Mark goes from text-edit mode to selected.
- Control returns to the application.
During the creation of polymarks, such as Polyline, Polyline Ruler or Polygon, two options can be enabled (both are disabled by default):
- Auto-rollback: when the user clicks on the last added point (for Polyline, Polyline Ruler, Curve, Polygon) or drags over it (for Freeline), the latest point is removed. This allows the user to fix mistakes in drawing a mark. See the IsPolyMarkAutoRollbackEnabled property.
- Auto-close: when the last point of the mark is quite close to the first one, and the mark has the IsClosed property, it is set to True. Marks that support the IsClosed property are Freeline and Polyline. See the IsPolylineAutoCloseEnabled property.
Note that ART ToolBar event handlers are implemented in the ART Forms open source code and can be modified at any time and in any way, but in order for them to work, your application needs to interact with the following events:
C# | Copy Code |
---|---|
private void imGearPageView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { igARTForms.MouseDown(sender, e); } private void imGearPageView_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { igARTForms.MouseMove(sender, e); } private void imGearPageView_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { igARTForms.MouseUp(sender, e); } |