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: teichgraf **

We just have it for a few methods right now and won't have the time to add it soon, but we appreciate code contributions. :)

- Rene


Viewing all articles
Browse latest Browse all 360

Trending Articles



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