void BitmapSetPixel(int bi, int x, int y, int color);


Sets the color value of a pixel.


Return Value


No return value.





Handle to the Bitmap surface.



The x coordinate of the pixel to be modified.



The y coordinate of the pixel to be modified.



The color, in hexadecimal, of the color to be applied to the pixel.  NOTE: this parameter expects your color value to be in the native iOS order: BGRA (blue, green, red, alpha), 4 bytes per pixel.  e.g. a hex value of 0x0000FFFF would specify full intensity red with full alpha.




BitmapSetPixel() sets the color value of a pixel on a Bitmap surface.  The color value is assumed to be pre-multiplied.  (see: BitmapSetPixel overview)  After calling this function, be sure to call BitmapUpdate() when you are ready for the Bitmap surface to be rendered.




Available in DragonFireSDK 1.3 and later.




The following example creates a 100 x 100 Bitmap surface and draws a black to blue gradient from left to right.


#include "DragonFireSDK.h"


int MyBitmap;

int Color;

int Blue;


void AppMain()


  MyBitmap = BitmapAdd(0, 0, 100, 100);

  Blue = 0;

  for (int x = 0; x < 100; x++)



     Color = ((Blue << 24) | (0 << 16) | (0 << 8) | 255);

    for (int y = 0; y < 100; y++)


        BitmapSetPixel(MyBitmap, x, y, Color);






void AppExit()





void OnTimer()