User Guide > How to Work with... > Windows Presentation Foundation (WPF) > Using ImageGear.Windows.Controls Namespace > Annotations > Custom Annotations > ImGearAnnotatorPolyController |
The abstract ImGearAnnotatorPolyController class derives from ImGearAnnotatorMarkController and can be used as a base class for point-based marks.
You must override the virtual CreateInProgressMark(ImGearAnnotatorCreateMarkData createMarkData) method to create a mark that is initially set as the PageView in-progress mark. The in-progress mark is the mark that is shown while creating the mark using the mouse, before the mark is added to the ART page. The createMarkData parameter contains data associated with the creation process, such as whether or not the user double-clicked the mouse or any custom data you need to keep track of the state of the creation process.
You can override the virtual DrawInProgressMark(ImGearARTMark mark, IEnumerable<ImGearPoint> points, ImGearAnnotatorCreateMarkData createMarkData) method to modify the in-progress mark while the user is moving or clicking the mouse during the mark creation process. The points parameter contains points indicating the locations in which the user has clicked the mouse.
This class overrides the CanCreateMark(IEnumerable<ImGearPoint> points, ImGearAnnotatorCreateMarkData createMarkData) method so that it returns true if 2 or more points have been specified and the mouse was double-clicked. You can override this method to specify when the in-progress mark should be added to the ART page.
By default the virtual CreateMark(ImGearARTMark mark, IEnumerable<ImGearPoint> points, ImGearAnnotatorCreateMarkData createMarkData) method returns the in-progress mark, which is then added to the ART page.
This class overrides the ManageCursor method to manage the cursor for point-based marks. You must override the Resize method to enable resizing your custom mark.
By default the PageView ShowMarkPropertiesWindow method and ShowMarkPropertiesWindow command will have no effect for a custom mark because the ImGearAnnotatorMarkController ShowPropertiesWindow method returns null. To show a properties window for a custom mark, you will need to override the ShowPropertiesWindow method to return an instance of a class that is derived from IImGearMarkEditorWindow. Information on the custom mark Properties context menu item and other custom mark context menu items can be found in the Context Menu section.