WPF: How to display an image at its original size?

后端 未结 5 1023
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 13:05

I have a problem with displaying images in WPF.

Here\'s my code:

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 13:21

    Adding to Paya's answer: to compensate WPF's attempt to adapt to the monitors resolution you should be able to set the Width and Height to the file's original dimensions and use Stretch="Fill". This worked for me.

提交回复
热议问题