开发者

Position Labels on top of Image

开发者 https://www.devze.com 2023-03-15 16:48 出处:网络
I used a image in WPF. On top of the image开发者_运维技巧 I positioned labels. When resizing my window the image also resizes, which is ok. However the labels should also reposition. So they keep on t

I used a image in WPF. On top of the image开发者_运维技巧 I positioned labels. When resizing my window the image also resizes, which is ok. However the labels should also reposition. So they keep on the same relative position on top of the image. Currently I'm using a canvas. I set the Canvas.Top and Canvas.Left properties for the labels. How can I fix the positioning of the labels when resizing.


Use a Viewbox and place your Canvas inside the ViewBox.


If you want put the label always on top of the image, simply use StackPanel.

0

精彩评论

暂无评论...
验证码 换一张
取 消