Hi there, it's my first post and i have a question.
Is there any way to improve graphics.h to make a funcion wich you can set the level of alpha transparency?
Let me explain:
I'm trying to port a little fade in and fade out Allegro funcion that uses "set_trans_blender" method, and the lib graphics.h does'nt any funcion like that...
Sorry About my very bad english... =x
png Alpha level
Code: Select all
void XgeSetImageOpacity(XgeImage* image, int opacity)
{
int i;
int size = image->TextureWidth * image->TextureHeight;
XgeColor* data = image->data;
for(i = 0; i < size; i++, data++)
*data = *data + (((int)((float)((float)0xFF / 100.00f) * (float)opacity) - A(*data)) << 24);
}
Get Xplora!