Quantcast
Channel: WriteableBitmapEx
Viewing all articles
Browse latest Browse all 360

New Post: Resizing Image distorts its pixels around corners

$
0
0
Hi!

I needed to resize an image so I used following code:
            WriteableBitmap img2 = new WriteableBitmap((int)width, (int)height);
            img2 = img.Resize((int)width, (int)height, WriteableBitmapExtensions.Interpolation.Bilinear);
destination.Blit(new Rect(coords.X, coords.Y, img2.PixelWidth, img2.PixelHeight), img2, new Rect(0,0, img2.PixelWidth, img2.PixelHeight));
            return destination;
But when i save this destination image it becomes distorted around the edges and gives me this image:
Image

Any ideas for what can be wrong here?

Viewing all articles
Browse latest Browse all 360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>