In Silverlight 3 there is now a WriteableBitmap which provides get/put pixel abilities. This can be done like so:
// setting a pixel example
WriteableBitmap bitmap = new WriteableBitmap(400, 200);
Color c = Colors.Purple;
bitmap.Pixels[0] = c.A << 24 | c.R << 16 | c.G << 8 | c.B;
Basically, setting a Pixel involves setting its color, and that comes by bitshifting the alpha, red, blue, green values into an integer.
My question is, how would you turn an integer back to a Color? What goes in the missing spot in this example:
// getting a pixel example
int colorAsInt = bitmap.Pixels[0];
Color c;
// TODO:: fill in the color c from the integer ??
Thanks for any help you might have, I'm just not up on my bit shifting and I'm sure others will run into this roadblock at some point.