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

Commented Feature: Overloads for int[] pixels [11060]

$
0
0
If many shapes need to be drawn, it's dramatically faster if a local reference to the Pixels array is passed to the methods directly.
 
int[] pixels = writeableBmp.Pixels;
int w = writeableBmp.PixelsWidth;
int h = writeableBmp.PixelsHeight;
for(int i = 0; i < 10000; i++)
{
DrawLine(pixels, w, h, ...);
}
 
is much faster than
 
for(int i = 0; i < 10000; i++)
{
DrawLine(writeableBmp, ...);
}
 
Another important point is multi-threading. The WriteableBitmap cannot be used in a background thread (Exception is thrown).
Comments: ** Comment from web user: ffMathy **

This is incredibly important. Right now, it's impossible in Windows Phone apps to do resizing and other heavy operations on large images in the background!


Viewing all articles
Browse latest Browse all 360

Trending Articles



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