ImageGear for Java User Guide > Using ImageGear for Java > Using com.accusoft.imagegear.art Package > Operating with ART Marks |
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.
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); |
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.
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.