I was just wondering if anyone knew (performance wise on wp7) the best way to update a WriteableBitmap pixel by pixel... I can see the Pixels.SetValue method which can take in a colour and a single location. But surely a faster option is to set an array first, then SetValue(theArray) all at once... something like this...
Int32[] pixels = bmp.Pixels;
for(Int32 y = 479; y > 0; y--)
for (Int32 x = 0; x < 480; x++)
{
pixels[x + (y * 480)] = 0;
}
bmp.Pixels.SetValue(pixels);
but there doesnt appear to be that option???
objviously here I am just setting everything to black... but if I want to do more...
So basically, Im just asking what is the best way to manipulate/create a bitmap pixel by pixel and get a best performance? (think updateing the bitmap on every tick)
edit: I just noticed that Texture2D.SetData<Int32>(theArray) has this functionality, can anyone comment on the performance of this? or perhaps recommend a better way of doing this?