void BitmapSetPixel(int bi, int x, int y, int r, int g, int b, int a);
Sets the color of a pixel on a Bitmap surface.
Return Value
No return value.
Parameters
bi The 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.
r The value (0-255) of the color red for the pixel to be modified.
g The value (0-255) of the color green for the pixel to be modified.
b The value (0-255) of the color blue for the pixel to be modified.
a The alpha value (0-255) for the pixel to be modified.
Remarks
BitmapSetPixel() sets the color value of a pixel on a Bitmap surface. 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 Blue;
void AppMain() { MyBitmap = BitmapAdd(0, 0, 100, 100); Blue = 0; for (int x = 0; x < 100; x++) { Blue+=2; for (int y = 0; y < 100; y++) { BitmapSetPixel(MyBitmap, x, y, 0, 0, Blue, 255); } } BitmapUpdate(MyBitmap); }
void AppExit() {
}
void OnTimer() {
} |