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
AnnClosedCurveObject Class
See Also  Members  
Leadtools.Windows.Annotations Namespace : AnnClosedCurveObject Class



The AnnClosedCurveObject Class supports WPF/Silverlight.

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

Defines a closed annotation curve object. Supported in Silverlight, Windows Phone 7

Object Model

AnnClosedCurveObject Class

Syntax

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

Example

This example creates a new closed curve object with 4 points.

Visual BasicCopy Code
Private Sub AnnClosedCurveObject_AnnClosedCurveObject(ByVal container As AnnContainer)
   Dim closedCurve As AnnClosedCurveObject = New AnnClosedCurveObject()
   closedCurve.Points.Add(New System.Windows.Point(100, 100))
   closedCurve.Points.Add(New System.Windows.Point(200, 100))
   closedCurve.Points.Add(New System.Windows.Point(200, 200))
   closedCurve.Points.Add(New System.Windows.Point(100, 300))
   closedCurve.Tension = 1
   closedCurve.Stroke = Colors.Red
   closedCurve.StrokeThickness = 2.0
   closedCurve.Fill = Colors.White
   closedCurve.FillRule = AnnFillRule.EvenOdd
   closedCurve.IsClosed = True
   container.Children.Add(closedCurve)
End Sub
C#Copy Code
private void AnnClosedCurveObject_AnnClosedCurveObject(AnnContainer container)
{
   AnnClosedCurveObject closedCurve = new AnnClosedCurveObject();
   closedCurve.Points.Add(new Point(100, 100));
   closedCurve.Points.Add(new Point(200, 100));
   closedCurve.Points.Add(new Point(200, 200));
   closedCurve.Points.Add(new Point(100, 300));
   closedCurve.Tension = 1;
   closedCurve.Stroke = Colors.Red;
   closedCurve.Fill = Colors.White;
   closedCurve.FillRule = AnnFillRule.EvenOdd;
   closedCurve.StrokeThickness = 2.0;
   closedCurve.IsClosed = true;
   container.Children.Add(closedCurve);
}
SilverlightCSharpCopy Code
private void AnnClosedCurveObject_AnnClosedCurveObject(AnnContainer container)
{
   AnnClosedCurveObject closedCurve = new AnnClosedCurveObject();
   closedCurve.Points.Add(new Point(100, 100));
   closedCurve.Points.Add(new Point(200, 100));
   closedCurve.Points.Add(new Point(200, 200));
   closedCurve.Points.Add(new Point(100, 300));
   closedCurve.Tension = 1;
   closedCurve.Stroke = Colors.Red;
   closedCurve.Fill = Colors.White;
   closedCurve.FillRule = AnnFillRule.EvenOdd;
   closedCurve.StrokeThickness = 2.0;
   closedCurve.IsClosed = true;
   container.Children.Add(closedCurve);
}
SilverlightVBCopy Code
Private Sub AnnClosedCurveObject_AnnClosedCurveObject(ByVal container As AnnContainer)
   Dim closedCurve As AnnClosedCurveObject = New AnnClosedCurveObject()
   closedCurve.Points.Add(New Point(100, 100))
   closedCurve.Points.Add(New Point(200, 100))
   closedCurve.Points.Add(New Point(200, 200))
   closedCurve.Points.Add(New Point(100, 300))
   closedCurve.Tension = 1
   closedCurve.Stroke = Colors.Red
   closedCurve.Fill = Colors.White
   closedCurve.FillRule = AnnFillRule.EvenOdd
   closedCurve.StrokeThickness = 2.0
   closedCurve.IsClosed = True
   container.Children.Add(closedCurve)
End Sub
XAMLCopy Code
<Window x:Class="WPFSamples.AnnClosedCurveObject" 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:AnnClosedCurveObject Stroke="Blue" StrokeThickness="3.0" FillRule="EvenOdd" IsClosed="True" Tension="1.0" Points="100,100 175, 125, 25,150 175,175 100,200" Header="Closed Curve Object">
    <Leadtools_Windows_Annotations:AnnClosedCurveObject.Fill>
      <LinearGradientBrush>
        <GradientStop Offset="0.0" Color="Black" />
        <GradientStop Offset="0.5" Color="Red" />
        <GradientStop Offset="1.0" Color="Yellow" />
      </LinearGradientBrush>
    </Leadtools_Windows_Annotations:AnnClosedCurveObject.Fill>
  </Leadtools_Windows_Annotations:AnnClosedCurveObject>
</Window>

Remarks

The closed curve object is a spline curve that contains a collection of System.Windows.Point points, a stroke, a fill and a tension value. The curve can be AnnPolygonObject.IsClosed or not, and can also have a certain AnnPolygonObject.FillRule.

For more information about the closed curve annotation object refer to AnnClosedCurveObject for WPF. For more information about the automated closed curve annotation object, refer to WPF Annotation Objects - Automated Features.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnPolylineObject
               Leadtools.Windows.Annotations.AnnPolygonObject
                  Leadtools.Windows.Annotations.AnnClosedCurveObject

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

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