I have
I need
XAML:
<Image Height="500"
MouseLeftButtonDown="image_MouseLeftButtonDown"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With