ImageGear for Java
Operating with ART Marks

This section provides information about the following:

Clipboard Operations

ART marks can be cut from and copied to the clipboard as well as pasted into an image individually or in groups. The ImGearARTPage Class provides the methods to perform clipboard operations.

Iterating Through Marks

Sometimes your application will need to iterate through the marks in an ImGearARTPage Class object. This can be done by using a "foreach" mechanism:

For example, to delete all selected marks, your application would do the following:

Java Example
Copy Code
// Build a list of selected marks.
ArrayList<ImGearARTMark> igARTMarks = new ArrayList<ImGearARTMark>();
for (ImGearARTMark igARTMark : igARTPage)
{
    if (igARTPage.MarkIsSelected(igARTMark))
        igARTMarks.add(igARTMark);
}
// Delete the marks.
igARTPage.RemoveMarks(igARTMarks);

Mark Groups

ImGearARTPage Class provides a facility called "mark groups" (or just "groups", for short) that provides a powerful mechanism for implementing application features. Every mark belongs to one and only one group; by default all marks belong to a group with index 0 and named "[Untitled]". Your application can create as many groups as needed - each group is given a unique index. ImGearARTPage Class provides a set of methods that manipulate all of the marks in a group (hide them all, make them all visible, etc.). Your application could use groups to provide annotation layers (each "layer" would simply be a group), so that the user could choose which layer, and thus which set of annotations to view. Alternatively, your application could use groups to provide private annotations (each person would only be able to see "their" annotations).

The various methods that operate on groups are provided by ImGearARTGroup Class and ImGearARTGroupArray Class objects.

Statistics

ImGearARTMark Class provides statistics that characterize a mark; they are values such as Length, Area, and Perimeter and are represented by the ImGearARTMarkStatistics class. Statistics can be accessed through the ImGearARTMark.getStatistics method. These measurements are available in different measurement units, like feet, meters, inches, or in user-defined measurement units. Users can select a needed measurement unit with the ImGearARTMarkStatistics.setUnit method.

To calculate lengths and areas correctly, statistics needs to have resolution values of the current image, which can be set using the ImGearARTMarkStatistics.setResolution method.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback