4
votes

I am displaying an image which if small, will fill the size of the control area. I want to display the actual original width and height of the image.

How can I do that?

2

2 Answers

2
votes

You actually kind of answered your own question. There are two dependency properties that you can use: ActualWidth and ActualHeight.

This will give you the size that the picture is using on the screen, not what is currently set, which is what Width and Height give you.

Also, these dependency properties are useable by any FrameworkElement I believe.

FrameworkElement.ActualWidth

FrameworkElement.ActualHeight