WPF: Strange image stretching in Buttons

后端 未结 3 1898
没有蜡笔的小新
没有蜡笔的小新 2021-01-23 03:51

I have multiple buttons, each having a 32x32 pixels PNG image. The strange thing is, that both buttons show different sizes (Yes, I triple checked that icons are really 32x32!).

3条回答
  •  被撕碎了的回忆
    2021-01-23 04:11

    To follow up on SLaks answer: To use the Pixel dimensions of the Image regardless of the DPI you can bind the Width and Height to the PixelWidth and PixelHeight of the Source like this

    
    

提交回复
热议问题