void BitmapSetPixel(int bi, int x, int y, int color);
Sets the color value of a pixel.
Return Value
No return value.
Parameters
bi Handle to the Bitmap surface.
x The x coordinate of the pixel to be modified.
y The y coordinate of the pixel to be modified.
color 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.
Remarks
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.
Availability
Available in DragonFireSDK 1.3 and later.
Example
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++) { Blue+=2; Color = ((Blue << 24) | (0 << 16) | (0 << 8) | 255); for (int y = 0; y < 100; y++) { BitmapSetPixel(MyBitmap, x, y, Color); } } BitmapUpdate(MyBitmap); }
void AppExit() {
}
void OnTimer() {
} |