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.
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
Howto set the postion of Textannotation.Textbox
Moderator: Alex
-
- Posts: 17
- Joined: Mon Jan 03, 2011 2:45 pm
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Howto set the postion of Textannotation.Textbox
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:
Best regards, Alexander
You can use the PointToControl method of the ImageViewer class and determine coordinates of left-top corner of annotation in the viewer space:
Code: Select all
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);
-
- Posts: 17
- Joined: Mon Jan 03, 2011 2:45 pm
Re: Howto set the postion of Textannotation.Textbox
Hello Alex,
it works perfectly.
Thank you very much.
best regards
Michael
it works perfectly.
Thank you very much.
best regards
Michael