Defines an annotation brush of a single color.
Syntax
Example
This example uses an AnnSolidBrush to red rectangle.
Visual Basic | Copy 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
Inheritance Hierarchy
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