Hi there,
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.
Best Regards,
Mark
Winforms - Show distance value of the ruler annotation to a text field.
Moderator: Alex
Winforms - Show distance value of the ruler annotation to a text field.
Last edited by markdhem on Fri Jul 06, 2018 10:14 am, edited 1 time in total.
Re: Winforms - Show distance value of the ruler annotation to a text field.
Hi Mark,
You can get the length of ruler using the RulerAnnotationData.Length property:
https://www.vintasoft.com/docs/vsimagin ... ength.html
You can get the unit of measure of ruler using the RulerAnnotationData.UnitOfMeasure property:
https://www.vintasoft.com/docs/vsimagin ... asure.html
Best regards, Alexander
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.
You can get the length of ruler using the RulerAnnotationData.Length property:
https://www.vintasoft.com/docs/vsimagin ... ength.html
You can get the unit of measure of ruler using the RulerAnnotationData.UnitOfMeasure property:
https://www.vintasoft.com/docs/vsimagin ... asure.html
Best regards, Alexander
Re: Winforms - Show distance value of the ruler annotation to a text field.
Hi Alex,
Thanks for your reply,
Here is my screenshot, https://drive.google.com/open?id=18Qsda ... qt5M1SU6Li.
I actually got it at now but it will only appears the pixels value. What I want is the millimeters.
Here is my code.
Regards,
Mark
Thanks for your reply,
Here is my screenshot, https://drive.google.com/open?id=18Qsda ... qt5M1SU6Li.
I actually got it at
Code: Select all
annotationViewer1_AnnotationTransformingFinished
Here is my code.
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();
}
Mark
Re: Winforms - Show distance value of the ruler annotation to a text field.
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.
https://www.vintasoft.com/docs/vsimagin ... asure.html
Best regards, Alexander