Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting current size of WPF controls

I have Image control in my Window. The size of this Image control is set to "Auto".

<Image x:Name="videoImg" Stretch="Fill" Height="Auto" Width="Auto" />

When i try to get access, it returns 0. How to see real size of this control? It resizes with window.

like image 399
Timur Mustafaev Avatar asked Oct 26 '11 13:10

Timur Mustafaev


1 Answers

You can use .ActualHeight and .ActualWidth to get the rendered Height/Width of a control

like image 110
Rachel Avatar answered Nov 06 '22 07:11

Rachel