Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Animate Palette
Message
From
08/08/2000 08:39:27
 
 
General information
Forum:
Visual C++
Category:
Other
Title:
Miscellaneous
Thread ID:
00402135
Message ID:
00402161
Views:
13
>Only color depths 256 or below have a palette. To do what you want to do you would need to use CLUT's (colour lookup tables) to alter the appearance of each pixel.
>
>
>
>unsigned int EncodeRGB(int r, int g, int b, int BPP)
>{
> unsigned int pixel;
>
> switch(BPP)
> {
> case 8:
> // You could do a palette lookup here.
> break;
>
> case 16:
> // This is for 5-6-5 format.
> pixel = ((r / 8) << 11) | ((g / 4) << 5) | (b / 8);
> break;
>
> case 24:
> case 32:
> pixel = (r << 16) | (g << 8) | (b);
> break;
>
> default:
> pixel = 0;
> }
>
> return pixel;
>}

How to use this function ?
I want alter color of block of pixels (rectagles, etc.) in timer event, without delay.

Jiri
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform