Leadtools.Dicom.Annotations Requires Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Brush Property
See Also  Example
Leadtools.Dicom.Annotations Namespace > DicomAnnotationsUtilities Class : Brush Property



Gets or sets the default brush used when calling ToAnnObject.

Syntax

Visual Basic (Declaration) 
Public Property Brush As AnnBrush
Visual Basic (Usage)Copy Code
Dim instance As DicomAnnotationsUtilities
Dim value As AnnBrush
 
instance.Brush = value
 
value = instance.Brush
C# 
public AnnBrush Brush {get; set;}
C++/CLI 
public:
property AnnBrush Brush {
   AnnBrush get();
   void set (AnnBrush value);
}

Return Value

The default brush used when calling ToAnnObject.

Example

This sample does the following:

  1. Creates a DicomTextObject ellipse
  2. Creates a converter
  3. Converts to a LEAD annotation
  4. Displays the LEAD annotation

Visual BasicCopy Code
Public Function DicomAnnotationsUtilities_Brush() As AnnObject
  ' Create a DicomTextAnnotation object -- a filled ellipse
  Dim dicomAnnotationObject As DicomGraphicObject = New Leadtools.Dicom.DicomGraphicObject()
  dicomAnnotationObject.Type = DicomAnnotationType.Ellipse
  dicomAnnotationObject.Filled = True
  Dim annotationPoints As DicomAnnotationPoint() = New DicomAnnotationPoint(3){}
  annotationPoints(0).X = 000.00F
  annotationPoints(0).Y = 100.00F
  annotationPoints(1).X = 300.00F
  annotationPoints(1).Y = 100.00F
  annotationPoints(2).X = 150.00F
  annotationPoints(2).Y = 000.00F
  annotationPoints(3).X = 150.00F
  annotationPoints(3).Y = 200.00F
  dicomAnnotationObject.SetAnnotationPoints(annotationPoints, annotationPoints.Length)

  ' Create an instance of the converter, and set some properties
  Dim du As DicomAnnotationsUtilities = New DicomAnnotationsUtilities()
  du.Pen = New AnnPen(Color.Blue, New AnnLength(3, AnnUnit.Pixel))
  du.Brush = New AnnSolidBrush(Color.Yellow)
  du.TextColor = Color.Brown

  ' Convert to a LEAD AnnObject
  Dim annObject As AnnObject = du.ToAnnObject(dicomAnnotationObject)
  Return annObject
 End Function
C#Copy Code
public AnnObject DicomAnnotationsUtilities_Brush() 

   // Create a DicomTextAnnotation object -- a filled ellipse 
   DicomGraphicObject dicomAnnotationObject = new Leadtools.Dicom.DicomGraphicObject(); 
   dicomAnnotationObject.Type = DicomAnnotationType.Ellipse; 
   dicomAnnotationObject.Filled = true; 
   DicomAnnotationPoint[] annotationPoints = new DicomAnnotationPoint[4]; 
   annotationPoints[0].X = 000.00F; 
   annotationPoints[0].Y = 100.00F; 
   annotationPoints[1].X = 300.00F; 
   annotationPoints[1].Y = 100.00F; 
   annotationPoints[2].X = 150.00F; 
   annotationPoints[2].Y = 000.00F; 
   annotationPoints[3].X = 150.00F; 
   annotationPoints[3].Y = 200.00F; 
   dicomAnnotationObject.SetAnnotationPoints(annotationPoints, annotationPoints.Length); 
 
   // Create an instance of the converter, and set some properties 
   DicomAnnotationsUtilities du = new DicomAnnotationsUtilities(); 
   du.Pen = new AnnPen(Color.Blue, new AnnLength(3, AnnUnit.Pixel)); 
   du.Brush = new AnnSolidBrush(Color.Yellow); 
   du.TextColor = Color.Brown; 
 
   // Convert to a LEAD AnnObject 
   AnnObject annObject = du.ToAnnObject(dicomAnnotationObject); 
   return annObject; 
}

Remarks

A DicomAnnotationObject can be filled but it has no color. A filled AnnObject has a color. When calling ToAnnObject to convert a DicomAnnotationObject, the Brush is the default brush if the object is filled.

Requirements

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

See Also

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