wpf - Get the size (after it has been "streched") of an item in a ViewBox -


Consider the following:

We say that the window is 1024x768 And the view box fills the entire window, this means that the text box on the screen is really big.

I want to get the size of the text box because it is currently on screen.

Update: I might get real-life of ViewBox and make it your child's true wide Which divides me into the current scale and will expose it as a property in some way but I'm not sure it's the best way to do it.

In this way you ScaleTransform to ViewBox Applies to your children:

  var child = VisualTreeHelper.GetChild (view box, 0) ContainerVisual; Var Scale = Children Conversion as ScaleTransform;   

Here is the view box that sits in the text box. After this you can only increase the scale.ScaleX * textbox.actualwidth and you may find the size in the screen coordinates

but it becomes easy! To get the size of that text box directly in the screen coordinates:

  textbox.PointToScreen (new point (textbox. Real point, text box, realheit)) - Text box. Pointtooscreen (new dot (0,0))  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -