Leadtools.MedicalViewer Requires Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
CalibrateRuler(Double,MedicalViewerMeasurementUnit) Method
See Also  Example
Leadtools.MedicalViewer Namespace > MedicalViewerCell Class > CalibrateRuler Method : CalibrateRuler(Double,MedicalViewerMeasurementUnit) Method




distance
The new length of the annotation ruler.
measurementUnit
The unit of measure
Changes the length of the selected annotation ruler according to the new value.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub CalibrateRuler( _
   ByVal distance As Double, _
   ByVal measurementUnit As MedicalViewerMeasurementUnit _
) 
Visual Basic (Usage)Copy Code
Dim instance As MedicalViewerCell
Dim distance As Double
Dim measurementUnit As MedicalViewerMeasurementUnit
 
instance.CalibrateRuler(distance, measurementUnit)
C# 
public void CalibrateRuler( 
   double distance,
   MedicalViewerMeasurementUnit measurementUnit
)
Managed Extensions for C++ 
public: void CalibrateRuler( 
   double distance,
   MedicalViewerMeasurementUnit measurementUnit
) 
C++/CLI 
public:
void CalibrateRuler( 
   double distance,
   MedicalViewerMeasurementUnit measurementUnit
) 

Parameters

distance
The new length of the annotation ruler.
measurementUnit
The unit of measure

Example

Calibrate a ruler if there is one to 10.0 cm

Visual BasicCopy Code
<Test> _
Public Sub MedicalViewerCalibrateRulerExample()
   Dim myForm As MedicalViewerForm = GetMedicalControl()
   Dim medicalViewer As MedicalViewer = myForm.Viewer
   Dim annotationAttributes As MedicalViewerAnnotationAttributes = medicalViewer.Cells(0).GetSelectedAnnotationAttributes(-2)
   Select Case annotationAttributes.Type
      Case MedicalViewerActionType.AnnotationRuler
         medicalViewer.Cells(0).CalibrateRuler(10.0, MedicalViewerMeasurementUnit.Centimeters)
      Case Else
         MessageBox.Show("You should add a ruler annotation to calibrate")
   End Select
   myForm.ShowDialog()
End Sub
C#Copy Code
public void MedicalViewerCalibrateRulerExample() 

   MedicalViewerForm myForm = GetMedicalControl(); 
   MedicalViewer medicalViewer = myForm.Viewer; 
 
   MedicalViewerAnnotationAttributes annotationAttributes = medicalViewer.Cells[0].GetSelectedAnnotationAttributes(-2); 
   switch (annotationAttributes.Type) 
   { 
      case MedicalViewerActionType.AnnotationRuler: 
         medicalViewer.Cells[0].CalibrateRuler(10.0, MedicalViewerMeasurementUnit.Centimeters); 
         break; 
      default: 
         MessageBox.Show("You should add a ruler annotation to calibrate"); 
         break; 
   } 
   myForm.ShowDialog(); 
}

Remarks

  • This method will calibrate all the rulers that are selected in the sub-cells included within the cell.
  • For more information, refer to Working With Annotations.

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

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