How can I fetch the distance of the ruler annotation to a text field in C# just like the image below.
Thank you in advance.
![Smile :)](./images/smilies/icon_e_smile.gif)
Best Regards,
Mark
Moderator: Alex
URL to your image is broken, please add new image.How can I fetch the distance of the ruler annotation to a text field in C# just like the image below.
Code: Select all
annotationViewer1_AnnotationTransformingFinished
Code: Select all
foreach (AnnotationView view in annotationViewer1.SelectedAnnotations)
{
// end the initialization of annotation view
EndInit(view.Data);
var size = view.Data.Size.Width;
var mmSize = size ; //What is the formula here?
textBox2.Text = mmSize.ToString();
}
You can change the unit of measure using the RulerAnnotationData.UnitOfMeasure property:now but it will only appears the pixels value. What I want is the millimeters.