문제

The images that my applications render on a WPF Canvas have widely varied dimensions. I prefer to scale/shift them so they precisely fit the current canvas, which may have been resized by the user.

How can I retrieve the canvas borders?

TIA

도움이 되었습니까?

해결책

You need to look in the XAML and find the ancestor of your Canvas (maybe further up the ancestor chain). One of them contains the ActualWidth and ActualHeight

Your are welcome.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top