1

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.

animuson
  • 53,861
  • 28
  • 137
  • 147
Marco
  • 4,817
  • 5
  • 34
  • 75

2 Answers2

0

Use a Viewbox and place your Canvas inside the ViewBox.

Navid Rahmani
  • 7,848
  • 9
  • 39
  • 57
0

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

DarthJDG
  • 16,511
  • 11
  • 49
  • 56