Image in WPF getting Blurry

前端 未结 7 900
慢半拍i
慢半拍i 2020-11-30 03:58

I am developing an application in WPF using C#. I am putting Images in a WrapPanel and showing inside a Grid with one more Border and using images in Buttons also. Problem i

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 04:27

    SnapsToDevicePixels seems not working for bitmaps.

    The NearestNeighbor options actually converts the bitmap and will end up with different one to the original bitmap.

    In WPF 4, a property "UseLayoutRounding" on the FrameworkElement is introduced to solve this problem.

    By setting this property to True on your root element, such as Window will align children elements on the edges of pixels.

    ...
    

提交回复
热议问题