ImageGear Professional v18.2 > User Guide > Using ImageGear > Using ImageGear ART Component > Creating, Saving, Loading, Modifying and Deleting ART Marks > Creating a Mark via the ToolBar |
End users can create a mark using the ART toolbar, or your application can create them directly by calling ART functions. This section describes how to create marks with user interaction through the ART toolbar.
When a button is selected from the toolbar, ART goes into "drawing mode", where the mouse is used to place and size the mark. The sequence of events depends on whether the mark is one of the types that contains text or not:
Mark does not contain text:
Mark contains text:
The right mouse-button click should display the context menu and cannot be used in the process of creating marks via the tool bar. |
Your application must implement 3 event handlers to make the ART ToolBar operable and to allow the user to create and modify ART marks using the mouse. Those 3 event handlers are as follows:
Copy Code
|
|
---|---|
Private Sub IGArtCtl1_ToolBarNotify(ByVal ButtonID As Long, ByVal Reason As Long) If (Not artPage Is Nothing) And CurIGPage.IsValid Then artPage.GlobalAttrMarkType = ButtonID End If End Sub Private Sub IGPageViewCtl1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long) Dim hMarkIndex, hMarkSelected As Long Dim fSelected As Boolean Dim dwSelectCount As Long igCurPoint.XPos = X igCurPoint.YPos = Y If (Not artPage Is Nothing) And CurIGPage.IsValid Then If 1 = Button Then artPage.InteractionProcess Button, 1, igCurPoint End If End If End Sub Private Sub IGPageViewCtl1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long) igCurPoint.XPos = X igCurPoint.YPos = Y If (Not artPage Is Nothing) And CurIGPage.IsValid Then If 1 = Button Then artPage.InteractionProcess Button, 2, igCurPoint End If End If End Sub Private Sub IGPageViewCtl1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long) Dim pointsArray As New IGPointArray igCurPoint.XPos = X igCurPoint.YPos = Y If (Not artPage Is Nothing) And CurIGPage.IsValid Then If 1 = Button Then artPage.InteractionProcess Button, 0, igCurPoint End If End If End Sub |