Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Animate Palette
Message
 
À
08/08/2000 08:16:33
Information générale
Forum:
Visual C++
Catégorie:
Autre
Titre:
Divers
Thread ID:
00402135
Message ID:
00402161
Vues:
14
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform