Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
AnnSolidBrush Class
See Also  Members   Example 
Leadtools.Annotations Namespace : AnnSolidBrush Class




Defines an annotation brush of a single color.

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnSolidBrush 
   Inherits AnnBrush
Visual Basic (Usage)Copy Code
Dim instance As AnnSolidBrush
C# 
[SerializableAttribute()]
public class AnnSolidBrush : AnnBrush 
Managed Extensions for C++ 
[SerializableAttribute()]
public __gc class AnnSolidBrush : public AnnBrush 
C++/CLI 
[SerializableAttribute()]
public ref class AnnSolidBrush : public AnnBrush 

Example

This example uses an AnnSolidBrush to red rectangle.

Visual BasicCopy Code
Public Sub AnnSolidBrush_AnnSolidBrush(ByVal graphics As Graphics, ByVal converter As AnnUnitConverter, ByVal rc As AnnRectangle)
   Dim annBrush As AnnSolidBrush = New AnnSolidBrush(Color.Red)
   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 AnnSolidBrush_AnnSolidBrush(Graphics graphics, AnnUnitConverter converter, AnnRectangle rc) 

   AnnSolidBrush annBrush = new AnnSolidBrush(Color.Red); 
   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.AnnSolidBrush

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

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