Sets a single pixel to the specified color value.


Use BitmapSetPixel(bi, x, y, r, g, b, a) to set red, green, blue and alpha value for the pixel at x, y.

Use BitmapSetPixel(bi, x, y, color) if you have pre-multiplied your color value.


The color provided here is a hex color 0xBBGGRRAA where blue, green, red and alpha are specified in an integer color.  If the alpha value is 255, the pixel is not transparent, and colors  will be written as specified.  If the alpha is less than 255, the pixel is transparent, and the BGR values must be pre-multiplied by alpha/255.  The iOS requires raw pixel data to be to be pre-multiplied for speed.  For example, if you wanted to specify a red pixel with a BGR value of 0x0000FF, but wanted it to be 50% transparent, the correct pre-multiplied color value would be 0x00008080.  The red component is stated as half of what is desired because the alpha is at 50%.


BitmapSetPixel(MyBitmap,10,10,255,0,0,128); //Specifies 255 red at max and alpha at 50% (255/2).


is the same as:


BitmapSetPixel(MyBitmap,10,10,0x00008080); // You must reverse the typical RGB order to BGR and pre-multiply values


NOTE:  For speed, these functions do not verify that x and y coordinates are in range of your Bitmap surface.




Available in DragonFireSDK 1.3 and later.