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

New Post: WinRT Blit image quality

$
0
0
Thanks for your reply. Indeed there has been a coordinate issue. :-/ The rects are (horizontal start point, vertical start point, width, height) instead of (horizontal start, vertical start, horizontal end, vertical end). It would be nice if the documentation can be updated.

So it has to be:
dest.DrawInto(backgroundImage, xDestOffset, yDestOffset, 0, 0, backgroundImage.PixelWidth, backgroundImage.PixelHeight);

 public static void DrawInto(this WriteableBitmap dest, WriteableBitmap backgroundImage, int xDestOffset, int yDestOffset, int xstart, int ystart, int xend, int yend)
{
  Rect destRect = new Windows.Foundation.Rect(xDestOffset, yDestOffset, xend-xstart, yend-ystart);
  Rect srcRect = new Windows.Foundation.Rect(xstart, ystart, xend - xstart, yend - ystart);
  dest.Blit(destRect, backgroundImage, srcRect, WriteableBitmapExtensions.BlendMode.None);
 }

Viewing all articles
Browse latest Browse all 360

Trending Articles



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