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



Encapsulates an annotation brush object with a linear gradient.

Syntax

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

Example

This example uses an AnnLinearGradientBrush to draw a rectangle.

Visual BasicCopy Code
Private Sub AnnLinearGradientBrush_AnnLinearGradientBrush(ByVal graphics As Graphics, ByVal converter As AnnUnitConverter, ByVal rc As AnnRectangle)
   Dim annBrush As AnnLinearGradientBrush = New AnnLinearGradientBrush(Color.Red, Color.Blue, LinearGradientMode.Horizontal)
   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
private void AnnLinearGradientBrush_AnnLinearGradientBrush(Graphics graphics, AnnUnitConverter converter, AnnRectangle rc) 

   AnnLinearGradientBrush annBrush = new AnnLinearGradientBrush(Color.Red, Color.Blue, LinearGradientMode.Horizontal); 
   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.AnnLinearGradientBrush

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

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