ImageGear .NET v25.2 - Updated
AddMark(ImGearARTMark,ImGearARTCoordinatesType,String) Method
Example 




ImageGear.Art Assembly > ImageGear.ART Namespace > ImGearARTPage Class > AddMark Method : AddMark(ImGearARTMark,ImGearARTCoordinatesType,String) Method
Reference to the mark to add.
Type of the coordinate system the mark coordinates are specified in.
Name of the group to add the mark to.
Adds the specified mark into the annotation page group specified by name.
Syntax
'Declaration
 
Public Overloads Function AddMark( _
   ByVal mark As ImGearARTMark, _
   ByVal type As ImGearARTCoordinatesType, _
   ByVal groupName As String _
) As Integer
'Usage
 
Dim instance As ImGearARTPage
Dim mark As ImGearARTMark
Dim type As ImGearARTCoordinatesType
Dim groupName As String
Dim value As Integer
 
value = instance.AddMark(mark, type, groupName)
public int AddMark( 
   ImGearARTMark mark,
   ImGearARTCoordinatesType type,
   string groupName
)
public: int AddMark( 
   ImGearARTMark* mark,
   ImGearARTCoordinatesType type,
   string* groupName
) 
public:
int AddMark( 
   ImGearARTMark^ mark,
   ImGearARTCoordinatesType type,
   String^ groupName
) 

Parameters

mark
Reference to the mark to add.
type
Type of the coordinate system the mark coordinates are specified in.
groupName
Name of the group to add the mark to.

Return Value

Integer value.
Remarks
You must specify the type of the mark's coordinate system. The mark will be drawn according to the type of its coordinate system.

Please make sure the mark does not have parent group (i.e. ImGearARTMark.ParentGroup is null), otherwise ImageGear.Core.ImGearException will be thrown. If the mark to be added already has parent group, please clone it prior to adding to the page.

Example
// Create and add some groups to the Groups array.
igARTPage.Groups.Add(new ImGearARTGroup("Group1", "First test group"));
igARTPage.Groups.Add(new ImGearARTGroup("Group2", "Second test group"));
// Create start and end point points.
ImGearPoint igPointStart = new ImGearPoint();
ImGearPoint igPointEnd = new ImGearPoint();
// Setup color for the line.
ImGearRGBQuad igRGBQuad = new ImGearRGBQuad(40, 40, 200);
// Create a series of diagonal lines adding each one to the 2 groups,
// alternating between them.
ImGearARTLine igARTLine;
for (int i = 0; i < 20; i++)
{
    igPointStart.X = i * 10;
    igPointStart.Y = 10;
    igPointEnd.X = i * 10 + 100;
    igPointEnd.Y = 110;
    igARTLine = new ImGearARTLine(igPointStart, igPointEnd, igRGBQuad);
    // Add the annotation to one of the 2 groups.
    if (i % 2 == 0)
        igARTPage.AddMark(igARTLine, ImGearARTCoordinatesType.IMAGE_COORD, "Group1");
    else
        igARTPage.AddMark(igARTLine, ImGearARTCoordinatesType.IMAGE_COORD, "Group2");
}
// Select Group1
igARTPage.Groups["Group1"].Select(true);
// Delete Group2
MessageBox.Show("Deleting second group of lines.", "Deleting...");
igARTPage.Groups["Group2"].RemoveAll();
' Create and add some groups to the Groups array.
igARTPage.Groups.Add(New ImGearARTGroup("Group1", "First test group"))
igARTPage.Groups.Add(New ImGearARTGroup("Group2", "Second test group"))
' Create start and end point points.
Dim igPointStart As New ImGearPoint()
Dim igPointEnd As New ImGearPoint()
' Setup color for the line.
Dim igRGBQuad As New ImGearRGBQuad(40, 40, 200)
' Create a series of diagonal lines adding each one to the 2 groups,
' alternating between them.
Dim igARTLine As ImGearARTLine
For i As Integer = 0 To 19
    igPointStart.X = i * 10
    igPointStart.Y = 10
    igPointEnd.X = i * 10 + 100
    igPointEnd.Y = 110
    igARTLine = New ImGearARTLine(igPointStart, igPointEnd, igRGBQuad)
    ' Add the annotation to one of the 2 groups.
    If i Mod 2 = 0 Then
        igARTPage.AddMark(igARTLine, ImGearARTCoordinatesType.IMAGE_COORD, "Group1")
    Else
        igARTPage.AddMark(igARTLine, ImGearARTCoordinatesType.IMAGE_COORD, "Group2")
    End If
Next
' Select Group1
igARTPage.Groups("Group1").[Select](True)
' Delete Group2
MessageBox.Show("Deleting second group of lines.", "Deleting...")
igARTPage.Groups("Group2").RemoveAll()
See Also

Reference

ImGearARTPage Class
ImGearARTPage Members
Overload List
ImGearARTMark Class
ImGearARTCoordinatesType Enumeration

Is this page helpful?
Yes No
Thanks for your feedback.