VintaSoft Annotation .NET Plug-in Discussions

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Howto set the postion of Textannotation.Textbox



Howto set the postion of Textannotation.Textbox

Post by MichaelHerrmanns »

Hello,

I have a question of howto positioning the textbox of an textannotation.
When I use the location propety of the textannotation, then sometimes depending on the resolution of the picture
the textbox appears on the right place. In other times the textbox appears somewhere.

The reason of my question is, that I want to open the textbox even when the textannotation is buildet.
https://www.vintasoft.com/forums/viewtopic.php?f=16&t=1722
In other situations (the user edit the text) the textbox everytime appears on the right place.

Best regards

Michael


Re: Howto set the postion of Textannotation.Textbox

Post by Alex »

Hello Michael,

You can use the PointToControl method of the ImageViewer class and determine coordinates of left-top corner of annotation in the viewer space:
Point leftTop = new Point((int)(textAnno.Location.X - textAnno.Size.Width / 2), (int)(textAnno.Location.Y - textAnno.Size.Height / 2));
textBox.Location = viewer.PointToControl(leftTop);
Best regards, Alexander


Re: Howto set the postion of Textannotation.Textbox

Post by MichaelHerrmanns »

Hello Alex,

it works perfectly.
Thank you very much.

best regards

Michael


Page 1 from 1: 1