LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
AnnGroupObject Class
See Also  Members  
Leadtools.Windows.Annotations Namespace : AnnGroupObject Class



The AnnGroupObject Class supports WPF/Silverlight.

The AnnGroupObject Class is available in LEADTOOLS Document and Medical Imaging toolkits.

This class provides support for creating and managing annotation group objects. Supported in Silverlight, Windows Phone 7

Object Model

AnnGroupObject ClassAnnObjectCollection ClassAnnObject Class

Syntax

Visual Basic (Declaration) 
Public Class AnnGroupObject 
   Inherits AnnRectangleObject
   Implements IAnnGroupIAnnHeaderIAnnObjectIAnnRectangle 
Visual Basic (Usage)Copy Code
Dim instance As AnnGroupObject
C# 
public class AnnGroupObject : AnnRectangleObject, IAnnGroupIAnnHeaderIAnnObjectIAnnRectangle  
C++/CLI 
public ref class AnnGroupObject : public AnnRectangleObject, IAnnGroupIAnnHeaderIAnnObjectIAnnRectangle  

Example

This example moves all the objects from a container into a new group object.

Visual BasicCopy Code
Private Sub AnnGroupObject_AnnGroupObject(ByVal container As AnnContainer)
   Dim group As AnnGroupObject = New AnnGroupObject()
   ' move the objects to the group
   Do While container.Children.Count > 0
      Dim obj As AnnObject = DirectCast(container.Children(0), AnnObject)
      container.Children.RemoveAt(0)
      group.Children.Add(obj)
   Loop

   ' add the group to the container
   container.Children.Add(group)
End Sub
C#Copy Code
private void AnnGroupObject_AnnGroupObject(AnnContainer container)
{
   AnnGroupObject group = new AnnGroupObject();
   // move the objects to the group
   while(container.Children.Count > 0)
   {
      AnnObject obj = container.Children[0] as AnnObject;
      container.Children.RemoveAt(0);
      group.Children.Add(obj);
   }

   // add the group to the container
   container.Children.Add(group);
}
SilverlightCSharpCopy Code
private void AnnGroupObject_AnnGroupObject(AnnContainer container)
{
   AnnGroupObject group = new AnnGroupObject();
   // move the objects to the group
   while(container.Children.Count > 0)
   {
      AnnObject obj = container.Children[0] as AnnObject;
      container.Children.RemoveAt(0);
      group.Children.Add(obj);
   }

   // add the group to the container
   container.Children.Add(group);
}
SilverlightVBCopy Code
Private Sub AnnGroupObject_AnnGroupObject(ByVal container As AnnContainer)
   Dim group As AnnGroupObject = New AnnGroupObject()
   ' move the objects to the group
   Do While container.Children.Count > 0
      Dim obj As AnnObject = TryCast(container.Children(0), AnnObject)
      container.Children.RemoveAt(0)
      group.Children.Add(obj)
   Loop

   ' add the group to the container
   container.Children.Add(group)
End Sub
XAMLCopy Code
<Window x:Class="WPFSamples.AnnGroupObject" Title="Leadtools.Windows.Annotations" Height="600" Width="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Annotations="clr-namespace:Leadtools.Windows.Annotations;assembly=Leadtools.Windows.Annotations">
  <Leadtools_Windows_Annotations:AnnContainer Background="Yellow">
    <!--Group Object-->
    <Leadtools_Windows_Annotations:AnnGroupObject IsTemporary="True">
      <!--Pointer Object-->
      <Leadtools_Windows_Annotations:AnnPointerObject X1="190" Y1="190" X2="100" Y2="100" Stroke="Red" StrokeThickness="4.0" />
      <!--Ellipse Object-->
      <Leadtools_Windows_Annotations:AnnEllipseObject Left="200" Top="100" Width="100" Height="100">
        <Leadtools_Windows_Annotations:AnnEllipseObject.Fill>
          <LinearGradientBrush>
            <GradientStop Offset="0.0" Color="#CCCCFF" />
            <GradientStop Offset="1.0" Color="Purple" />
          </LinearGradientBrush>
        </Leadtools_Windows_Annotations:AnnEllipseObject.Fill>
      </Leadtools_Windows_Annotations:AnnEllipseObject>
      <!--RubberStamp Object-->
      <Leadtools_Windows_Annotations:AnnRubberStampObject Left="150" Top="250" Width="150" Height="100" Type="Approved" />
      <!--TextPointer Object-->
      <Leadtools_Windows_Annotations:AnnTextPointerObject Left="310" Top="300" Width="250" Height="250" PointerPosition="350, 100" IsFixedPointer="True" Stroke="Black" StrokeThickness="2.0" Fill="Green" Text="LEADTOOLS WPF Annotations" FontFamily="Arial" FontStyle="Italic" FontWeight="Normal" FontStretch="Normal" FontSize="16" FontDecorations="Baseline" TextHorizontalAlignment="Center" TextVerticalAlignment="Center" TextEdgeMargin="0.0" TextRotate="Rotate0">
        <Leadtools_Windows_Annotations:AnnTextPointerObject.TextBrush>
          <LinearGradientBrush>
            <GradientStop Offset="0.0" Color="Black" />
            <GradientStop Offset="0.5" Color="Red" />
            <GradientStop Offset="1.0" Color="Yellow" />
          </LinearGradientBrush>
        </Leadtools_Windows_Annotations:AnnTextPointerObject.TextBrush>
      </Leadtools_Windows_Annotations:AnnTextPointerObject>
      <Leadtools_Windows_Annotations:AnnStampObject Left="150" Top="400" Width="150" Height="100">
        <Leadtools_Windows_Annotations:AnnStampObject.Picture>
          <Leadtools_Windows_Annotations:AnnPicture TransparentMode="None" TransparentColor="#000000">
            <Leadtools_Windows_Annotations:AnnPicture.Image>
              <BitmapImage UriSource="C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\ScarletMacaws.jpg" />
            </Leadtools_Windows_Annotations:AnnPicture.Image>
          </Leadtools_Windows_Annotations:AnnPicture>
        </Leadtools_Windows_Annotations:AnnStampObject.Picture>
      </Leadtools_Windows_Annotations:AnnStampObject>
    </Leadtools_Windows_Annotations:AnnGroupObject>
  </Leadtools_Windows_Annotations:AnnContainer>
</Window>

Remarks

The annotation group object contains a collection of annotation objects from any class that is derived from theAnnObject class. This collection of objects can be treated as one while they are in a group. An annotation object can be in either a container or a group but not both at the same time.

For more information about grouping and ungrouping, refer to Grouping and Ungrouping WPF Annotation Objects.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnRectangleObject
               Leadtools.Windows.Annotations.AnnGroupObject

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

AnnGroupObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.