Defines an annotation brush with a hatch style, a foreground color, and a background color.
Syntax
Example
This example uses an AnnHatchBrush to draw hatch pattern.
Visual Basic | Copy 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
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also