Leadtools.Dicom.Annotations Namespace > DicomAnnotationsUtilities Class : ToAnnObject Method |
public object ToAnnObject( DicomAnnotationObject dicomAnnotationObject )
'Declaration Public Function ToAnnObject( _ ByVal dicomAnnotationObject As DicomAnnotationObject _ ) As Object
'Usage Dim instance As DicomAnnotationsUtilities Dim dicomAnnotationObject As DicomAnnotationObject Dim value As Object value = instance.ToAnnObject(dicomAnnotationObject)
public object ToAnnObject( DicomAnnotationObject dicomAnnotationObject )
function Leadtools.Dicom.Annotations.DicomAnnotationsUtilities.ToAnnObject( dicomAnnotationObject )
public: Object^ ToAnnObject( DicomAnnotationObject^ dicomAnnotationObject )
Public Function DicomAnnotationsUtilities_ToAnnObject() As AnnObject ' Create a DicomTextAnnotation object -- text object with an anchor Dim dicomAnnotationObject As DicomTextObject = New Leadtools.Dicom.DicomTextObject() dicomAnnotationObject.TLHCorner = New DicomAnnotationPoint(100, 250) dicomAnnotationObject.BRHCorner = New DicomAnnotationPoint(200, 350) dicomAnnotationObject.AnchorPointVisible = True dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel dicomAnnotationObject.AnchorPoint = New DicomAnnotationPoint(300, 300) dicomAnnotationObject.AnchorPointVisible = True dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right dicomAnnotationObject.TextValue = "Right justified with blue border" ' Create an instance of the converter, and customize the defaults for the annotations by ' creating a default object and assigning it to the DefaultObject property Dim du As New DicomAnnotationsUtilities() Dim defaultAnnObject As New AnnTextObject() ' Pen defaultAnnObject.Pen = New AnnPen(Color.Blue, New AnnLength(3)) defaultAnnObject.Brush = New AnnSolidBrush(Color.Purple) ' Font defaultAnnObject.Font = New AnnFont("Courier", New AnnLength(16), FontStyle.Bold) ' Text defaultAnnObject.Alignment = StringAlignment.Far defaultAnnObject.TextColor = Color.Green du.DefaultObject = defaultAnnObject ' Convert to a LEAD AnnObject Dim annObject As AnnObject = TryCast(du.ToAnnObject(dicomAnnotationObject), AnnObject) Return annObject End Function
public AnnObject DicomAnnotationsUtilities_ToAnnObject() { // Create a DicomTextAnnotation object -- text object with an anchor DicomTextObject dicomAnnotationObject = new Leadtools.Dicom.DicomTextObject(); dicomAnnotationObject.TLHCorner = new DicomAnnotationPoint(100, 250); dicomAnnotationObject.BRHCorner = new DicomAnnotationPoint(200, 350); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.AnchorPoint = new DicomAnnotationPoint(300, 300); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right; dicomAnnotationObject.TextValue = "Right justified with blue border"; // Create an instance of the converter, and customize the defaults for the annotations by // creating a default object and assigning it to the DefaultObject property DicomAnnotationsUtilities du = new DicomAnnotationsUtilities(); AnnTextObject defaultAnnObject = new AnnTextObject(); // Pen defaultAnnObject.Pen = new AnnPen(Color.Blue, new AnnLength(3)); defaultAnnObject.Brush = new AnnSolidBrush(Color.Purple); // Font defaultAnnObject.Font = new AnnFont("Courier", new AnnLength(16), FontStyle.Bold); // Text defaultAnnObject.Alignment = StringAlignment.Far; defaultAnnObject.TextColor = Color.Green; du.DefaultObject = defaultAnnObject; // Convert to a LEAD AnnObject AnnObject annObject = du.ToAnnObject(dicomAnnotationObject) as AnnObject; return annObject; }
public AnnObject DicomAnnotationsUtilities_ToAnnObject() { // Create a DicomTextAnnotation object -- text object with an anchor DicomTextObject dicomAnnotationObject = new Leadtools.Dicom.DicomTextObject(); dicomAnnotationObject.TLHCorner = new DicomAnnotationPoint(100, 250); dicomAnnotationObject.BRHCorner = new DicomAnnotationPoint(200, 350); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.AnchorPoint = new DicomAnnotationPoint(300, 300); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right; dicomAnnotationObject.TextValue = "Right justified with blue border"; // Create an instance of the converter, and customize the defaults for the annotations by // creating a default object and assigning it to the DefaultObject property DicomAnnotationsUtilities du = new DicomAnnotationsUtilities(); AnnTextObject defaultAnnObject = new AnnTextObject(); // Pen defaultAnnObject.Stroke = Color.FromArgb(255, 0, 0, 255); defaultAnnObject.StrokeThickness = 3; defaultAnnObject.Fill = Color.FromArgb(128, 0, 255, 255); // Font defaultAnnObject.FontFamilyName = "Courier"; defaultAnnObject.FontSize = 16; defaultAnnObject.FontStretch = AnnFontStretches.Normal; defaultAnnObject.FontStyle = AnnFontStyle.Italic; defaultAnnObject.FontWeight = AnnFontWeight.Bold; // Text defaultAnnObject.TextHorizontalAlignment = AnnTextAlignment.Far; defaultAnnObject.Foreground = Color.FromArgb(255, 255, 0, 255); du.DefaultObject = defaultAnnObject; // Convert to a LEAD AnnObject AnnObject annObject = du.ToAnnObject(dicomAnnotationObject) as AnnObject; return annObject; }
Public Function DicomAnnotationsUtilities_ToAnnObject() As AnnObject ' Create a DicomTextAnnotation object -- text object with an anchor Dim dicomAnnotationObject As DicomTextObject = New DicomTextObject() dicomAnnotationObject.TLHCorner = New DicomAnnotationPoint(100, 250) dicomAnnotationObject.BRHCorner = New DicomAnnotationPoint(200, 350) dicomAnnotationObject.AnchorPointVisible = True dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel dicomAnnotationObject.AnchorPoint = New DicomAnnotationPoint(300, 300) dicomAnnotationObject.AnchorPointVisible = True dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right dicomAnnotationObject.TextValue = "Right justified with blue border" ' Create an instance of the converter, and customize the defaults for the annotations by ' creating a default object and assigning it to the DefaultObject property Dim du As DicomAnnotationsUtilities = New DicomAnnotationsUtilities() Dim defaultAnnObject As AnnTextObject = New AnnTextObject() ' Pen defaultAnnObject.Stroke = Color.FromArgb(255, 0, 0, 255) defaultAnnObject.StrokeThickness = 3 defaultAnnObject.Fill = Color.FromArgb(128, 0, 255, 255) ' Font defaultAnnObject.FontFamilyName = "Courier" defaultAnnObject.FontSize = 16 defaultAnnObject.FontStretch = AnnFontStretches.Normal defaultAnnObject.FontStyle = AnnFontStyle.Italic defaultAnnObject.FontWeight = AnnFontWeight.Bold ' Text defaultAnnObject.TextHorizontalAlignment = AnnTextAlignment.Far defaultAnnObject.Foreground = Color.FromArgb(255, 255, 0, 255) du.DefaultObject = defaultAnnObject ' Convert to a LEAD AnnObject Dim annObject As AnnObject = TryCast(du.ToAnnObject(dicomAnnotationObject), AnnObject) Return annObject End Function
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2