←Select platform

AnnPen Class

Summary

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

Syntax

C#
VB
C++
[SerializableAttribute()] 
public class AnnPen 
  
<SerializableAttribute()> 
Public Class AnnPen  
   Implements System.ICloneable  
[SerializableAttribute()] 
public ref class AnnPen : public System.ICloneable   

Example

This example uses an AnnPen to draw a dotted rectangle.

C#
VB
using Leadtools; 
using Leadtools.Annotations; 
using Leadtools.Codecs; 
using Leadtools.WinForms; 
 
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); 
   } 
} 
Imports Leadtools 
Imports Leadtools.Annotations 
Imports Leadtools.Codecs 
Imports Leadtools.WinForms 
 
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 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly