ImageGear .NET v24.12 - Updated
Custom Mark Statistics
User Guide > How to Work with... > ART Mark Annotations > Custom Annotations > Custom Mark Statistics

The ImageGear ART component provides mark statistics support, implemented for all standard ART marks as an object of type ImGearARTMarkStatistics attached to each Mark object. This object provides a set of read-only properties that get some measured values of the mark, like Area, Perimeter and Length.

Since the structure of any custom mark is unknown to ART, it is impossible to calculate custom mark’s area or size in ART, and you will have to implement a statistics class. To do this, you must:

  1. Create a new class derived from ImGearARTMarkStatistics and override its properties.
  2. Override custom mark’s Statistics properties to create an object of the class mentioned above, instead of the standard ImGearARTMarkStatistics object.

The ImageGear ART samples demonstrate this in the SectorMarkStatistics class and SectorMark.Statistics property.

ImGearARTMarkStatistics has two protected properties, AspectX and AspectY. These properties are used to convert sizes/areas calculated in pixels, into other measurement units, such as inches, meters etc. These values are calculated internally by current image resolution and currently selected measurement unit (see ImGearARTMarkStatistics properties description). Use these properties in the same manner as in the sample SectorMarkStatistics class, i.e., the real area can be obtained as an area in pixels multiplied by AspectX and AspectY, but for linear measures you’ll need to multiply any x-projection and y-projection separately, before calculating the whole distance.