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



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

Defines an object used to draw lines and curves for Annotation objects.

Object Model

AnnPen ClassAnnLength Structure

Syntax

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

Example

This example uses an AnnPen to draw a dotted rectangle.

Visual BasicCopy Code
Private Sub AnnPen_AnnPen(ByVal graphics As Graphics, ByVal converter As AnnUnitConverter, ByVal rc As AnnRectangle)
   Dim annPen As AnnPen = New AnnPen(Color.Blue, New AnnLength(2, AnnUnit.Pixel))
   annPen.Alignment = PenAlignment.Center
   annPen.DashStyle = DashStyle.Dot
   Dim gdiPen As Pen = annPen.Create(converter)
   Try
      Dim rect As RectangleF = rc.ConvertTo(converter, AnnUnit.Pixel).ToRectangleF()
      graphics.DrawRectangle(gdiPen, rect.Left, rect.Top, rect.Width, rect.Height)
   Finally
      CType(gdiPen, IDisposable).Dispose()
   End Try
End Sub
C#Copy Code
private void AnnPen_AnnPen(Graphics graphics, AnnUnitConverter converter, AnnRectangle rc)
{
   AnnPen annPen = new AnnPen(Color.Blue, new AnnLength(2, AnnUnit.Pixel));
   annPen.Alignment = PenAlignment.Center;
   annPen.DashStyle = DashStyle.Dot;
   using(Pen gdiPen = annPen.Create(converter))
   {
      RectangleF rect = rc.ConvertTo(converter, AnnUnit.Pixel).ToRectangleF();
      graphics.DrawRectangle(gdiPen, rect.Left, rect.Top, rect.Width, rect.Height);
   }
}

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnPen

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