This class provides support for creating and managing annotation group objects.
public class AnnGroupObject : Leadtools.Windows.Annotations.AnnRectangleObject, Leadtools.Windows.Annotations.IAnnGroup, Leadtools.Windows.Annotations.IAnnHeader, Leadtools.Windows.Annotations.IAnnObject, Leadtools.Windows.Annotations.IAnnRectangle
Public Class AnnGroupObject
Inherits Leadtools.Windows.Annotations.AnnRectangleObject
Implements Leadtools.Windows.Annotations.IAnnGroup, Leadtools.Windows.Annotations.IAnnHeader, Leadtools.Windows.Annotations.IAnnObject, Leadtools.Windows.Annotations.IAnnRectangle
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.
This example moves all the objects from a container into a new group object.
Imports Leadtools.Windows.Annotations
Imports Leadtools.Windows.Controls
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
using Leadtools.Windows.Annotations;
using Leadtools.Windows.Controls;
using Leadtools.Demos;
using Leadtools.Help;
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);
}
using Leadtools.Windows.Annotations;
using Leadtools.Windows.Controls;
using Leadtools.Examples;
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);
}
Imports Leadtools.Windows.Annotations
Imports Leadtools.Windows.Controls
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
<Window x:Class="WPFSamples.AnnGroupObject"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Leadtools.Windows.Annotations" Height="600" Width="800"
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"
>
<Leadtools_Windows_Annotations:AnnGroupObject.Children>
<!--Pointer Object-->
<Leadtools_Windows_Annotations:AnnPointerObject
Start="190,190"
End="100,100"
Stroke="Red"
StrokeThickness="4.0"/>
<!--Ellipse Object-->
<Leadtools_Windows_Annotations:AnnEllipseObject Rect="200,100,100,100">
<Leadtools_Windows_Annotations:AnnEllipseObject.FillBrush>
<Leadtools_Windows_Annotations:AnnLinearGradientBrush>
<Leadtools_Windows_Annotations:AnnLinearGradientBrush.GradientStops>
<Leadtools_Windows_Annotations:AnnGradientStop Offset="0.0" Color="#CCCCFF" />
<Leadtools_Windows_Annotations:AnnGradientStop Offset="1.0" Color="Purple" />
</Leadtools_Windows_Annotations:AnnLinearGradientBrush.GradientStops>
</Leadtools_Windows_Annotations:AnnLinearGradientBrush>
</Leadtools_Windows_Annotations:AnnEllipseObject.FillBrush>
</Leadtools_Windows_Annotations:AnnEllipseObject>
<!--RubberStamp Object-->
<Leadtools_Windows_Annotations:AnnRubberStampObject
Rect="150,250,150,100"
Type="Approved" />
<!--TextPointer Object-->
<Leadtools_Windows_Annotations:AnnTextPointerObject
Rect="310,300,250,250"
PointerPosition="350, 100"
IsFixedPointer="True"
Stroke="Black"
StrokeThickness="2.0"
Fill="Green"
Text="LEADTOOLS WPF Annotations"
FontFamilyName="Arial"
FontStyle="Italic"
FontWeight="Normal"
FontStretch="Normal"
FontSize="16"
Foreground="Black"
FontDecoration="Baseline"
TextHorizontalAlignment="Center"
TextVerticalAlignment="Center"
TextEdgeMargin="0.0"
TextRotate="Rotate0"
>
</Leadtools_Windows_Annotations:AnnTextPointerObject>
<Leadtools_Windows_Annotations:AnnStampObject Rect="150,400,150,100">
<Leadtools_Windows_Annotations:AnnStampObject.Picture>
<Leadtools_Windows_Annotations:AnnPicture TransparentMode="None" TransparentColor="#000000">
<Leadtools_Windows_Annotations:AnnPicture.Image>
<BitmapImage UriSource="c:\users\Public\Documents\LEADTOOLS 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.Children>
</Leadtools_Windows_Annotations:AnnGroupObject>
</Leadtools_Windows_Annotations:AnnContainer>
</Window>
Products |
Support |
Feedback: AnnGroupObject Class - Leadtools.Windows.Annotations |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.