LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

AnnPen Class

Example 





Members 
Defines an object used to draw lines and curves for Annotation objects.
Object Model
AnnPen ClassAnnLength Structure
Syntax
[SerializableAttribute()]
public class AnnPen : System.ICloneable  
'Declaration
 
<SerializableAttribute()>
Public Class AnnPen 
   Implements System.ICloneable 
'Usage
 
Dim instance As AnnPen
public sealed class AnnPen : System.ICloneable  
function Leadtools.Annotations.AnnPen()
[SerializableAttribute()]
public ref class AnnPen : public System.ICloneable  
Example
 
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
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);
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnPen Members
Leadtools.Annotations Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.