// 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();