pixel_for_vec(COLOR*,var alpha,var format);
Converts a color and alpha value into a pixel in the given format.
Parameters:
COLOR* |
BGR color vector. |
alpha |
Pixel transparency, 0..100. |
format |
Pixel format: 565, 888, 1555, 4444, or 8888. |
Returns:
Pixel value converted from color, alpha, and format.
Speed:
Fast
Example:
BMAP* tgablitz = "test.bmp";
function paint_plus_sign()
{
// paint a crosshair in a bitmap
var format;
var pixel;
var temp[3];
format = bmap_lock(tgablitz,0);
vec_set(temp,vector(0,0,255)); // red color
pixel = pixel_for_vec(temp,100,format);
pixel_to_bmap(tgablitz,10,10,pixel);
pixel_to_bmap(tgablitz,10,11,pixel);
pixel_to_bmap(tgablitz,10,12,pixel);
pixel_to_bmap(tgablitz,10,13,pixel);
pixel_to_bmap(tgablitz,10,14,pixel);
pixel_to_bmap(tgablitz,8,12,pixel);
pixel_to_bmap(tgablitz,9,12,pixel);
pixel_to_bmap(tgablitz,11,12,pixel);
pixel_to_bmap(tgablitz,12,12,pixel);
bmap_unlock(tgablitz);
}
See also:
pixel_to_vec
► latest
version online