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



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

Defines an annotation brush with a hatch style, a foreground color, and a background color.

Object Model

AnnHatchBrush Class

Syntax

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

Example

This example uses an AnnHatchBrush to draw hatch pattern.

Visual BasicCopy Code
Public Sub AnnHatchBrush_AnnHatchBrush(ByVal graphics As Graphics, ByVal converter As AnnUnitConverter, ByVal rc As AnnRectangle)
   Dim annBrush As AnnHatchBrush = New AnnHatchBrush(HatchStyle.Cross, Color.Red, Color.White)
   Dim gdiBrush As Brush = annBrush.Create(converter, rc)
   Try
      Dim rect As RectangleF = rc.ConvertTo(converter, AnnUnit.Pixel).ToRectangleF()
      graphics.FillRectangle(gdiBrush, rect)
   Finally
      CType(gdiBrush, IDisposable).Dispose()
   End Try
End Sub
C#Copy Code
public void AnnHatchBrush_AnnHatchBrush(Graphics graphics, AnnUnitConverter converter, AnnRectangle rc)
{
   AnnHatchBrush annBrush = new AnnHatchBrush(HatchStyle.Cross, Color.Red, Color.White);
   using(Brush gdiBrush = annBrush.Create(converter, rc))
   {
      RectangleF rect = rc.ConvertTo(converter, AnnUnit.Pixel).ToRectangleF();
      graphics.FillRectangle(gdiBrush, rect);
   }
}

Remarks

Annotation brushes are used to fill the interiors of annotation objects like rectangles, ellipses, polygons, etc.

For more information, refer to Changing Annotation Automation Background Colors.

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnBrush
      Leadtools.Annotations.AnnHatchBrush

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