开发者

WPF Image, how to remove blur?

I have

WPF Image, how to remove blur?

I need

WPF Image, how to remove blur?

XAML:

<Image Height="500"
       MouseLeftButtonDown="image_MouseL开发者_运维问答eftButtonDown"
       MouseRightButtonDown="image_MouseRightButtonDown"
       Name="image"
       Stretch="Fill"
       Width="500" />`

C#:

  wbmap = new WriteableBitmap(50, 50, 500, 500, PixelFormats.Indexed8, palette);
  wbmap.WritePixels(new Int32Rect(0, 0, wbmap.PixelWidth, wbmap.PixelHeight), pixels, wbmap.PixelWidth * wbmap.Format.BitsPerPixel / 8, 0);
  image.Source = wbmap;


As tkerwin mentioned, change the BitmapScalingMode to NearestNeighbor in you XAML Image code:

RenderOptions.BitmapScalingMode="NearestNeighbor"


Perhaps you need to change the bitmap scaling mode to nearest neighbor.

Add RenderOptions.BitmapScalingMode="NearestNeighbor" to your Image tag.


Increase resolution / scale without anti-aliasing.

Whats happening is WPF is scaling the image but "averaging" the pixels, rather than doing a more blocky scale.

See this post:

Resize bitmap like in MS Paint

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜