ImageGear Professional v18.2 > User Guide > Using ImageGear > Using ImageGear ART Component > Creating, Saving, Loading, Modifying and Deleting ART Marks > Edit Mode, Run Mode, and View Mode |
Each IGArtPage Object is always in one of three modes:
Your application can switch an IGArtPage Object from one mode to the other by simply setting the UserMode Property.
While an IGArtPage Object is in View-only mode, your application will not have to deal with any ART-related events: it simply loads the image and ART marks and displays the image (the ART marks are displayed automatically).
If your application switches IGArtPage Object into Run mode, then it will have to start dealing with a specific ART-related event: MouseNotify Event. For example, for a Encryption mark, when the image and ART marks are first loaded and displayed, the Encryption mark will obscure some or all of the image. When the user moves the cursor over the mark, the cursor will change to the ART_CURSOR_OVER_MARK (pointing hand) and your MouseNotify Event handler will be called with a reason code of ART_MOUSE_ENTER. Your event handler could display a dialog box asking for the password to enable viewing of that portion of the image, and then (if the user gets the password right), reveal the image. The code would look like this:
Copy Code
|
|
---|---|
Private IGArtCtl1_MouseNotify(pPage As IGArtPage, MarkIndex As Long, Reason As Long, PointX As Long, PointY As Long) Dim i As Long |
Dim password As String
Copy Code
|
|
---|---|
If Reason = ART_MOUSE_LBUTTON_UP Then artPage.MarkQuery MarkIndex If artPage.AttrMarkType = ART_MARK_ENCRYPTION Then password = InputBox( "Enter password to see this part of image:", "Encryption Mark") If password = artPage.AttrPassword Then artPage.MarkVisible MarkIndex, False End If End If End If End Sub |
If your application switches IGArtPage Object into Edit mode, then it will have to implement the 3 event handlers listed in Creating a Mark via the ToolBar, and (depending on the functionality you need to provide) others. Note that, while your IGArtPage Object is in Edit mode, then it will not raise the MouseNotify Event.