LEADTOOLS Annotations (Leadtools.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
AnnDrawable Class
See Also  Members  
Leadtools.Annotations Namespace : AnnDrawable Class



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

This is the base class for all annotation objects used in the Annotations class library.

Object Model

AnnDrawable ClassAnnBrush ClassAnnFont ClassAnnPen Class

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnDrawable 
   Implements ISerializable 
Visual Basic (Usage)Copy Code
Dim instance As AnnDrawable
C# 
[SerializableAttribute()]
public class AnnDrawable : ISerializable  
C++/CLI 
[SerializableAttribute()]
public ref class AnnDrawable : public ISerializable  

Example

This example changes all the objects in an annotation container so they use a red pen, a white brush and an Arial font.

Visual BasicCopy Code
Public Sub AnnDrawable_AnnDrawable(ByVal container As AnnContainer)
   For Each drawable As AnnDrawable In container.Objects
      If drawable.SupportsPen Then
         drawable.Pen = New AnnPen(Color.Red, New AnnLength(1, AnnUnit.Pixel))
      End If
      If drawable.SupportsBrush Then
         drawable.Brush = New AnnSolidBrush(Color.White)
      End If

      If drawable.SupportsFont Then
         drawable.Font = New AnnFont("Arial", New AnnLength(10, AnnUnit.Point), FontStyle.Regular)
         drawable.TextColor = Color.Red
      End If
   Next drawable
End Sub
C#Copy Code
public void AnnDrawable_AnnDrawable(AnnContainer container)
{
   foreach(AnnDrawable drawable in container.Objects)
   {
      if(drawable.SupportsPen)
         drawable.Pen = new AnnPen(Color.Red, new AnnLength(1, AnnUnit.Pixel));
      if(drawable.SupportsBrush)
         drawable.Brush = new AnnSolidBrush(Color.White);

      if(drawable.SupportsFont)
      {
         drawable.Font = new AnnFont("Arial", new AnnLength(10, AnnUnit.Point), FontStyle.Regular);
         drawable.TextColor = Color.Red;
      }
   }
}

Remarks

This class holds common drawing information shared by all annotation objects in the Annotations class library.

You can query the properties of this class to easily figure out if a certain class supports pen, brush or font and quickly change them. For example the properties dialogs used in the automation mode do just that to test whether to display the pen options.

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnDrawable
      Leadtools.Annotations.AnnControlPoint
      Leadtools.Annotations.AnnObject

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features