suivant: Fonctions avancées : Événements
monter: More1
précédent: Entrée/Sortie Images
(au format de l'écran : 8, 15, 16 ou 24 bits).
- Type: WinImage
- Variable donnant le format de l'écran: winDepth
- WinImage winCreateImage(int w, int h, int grey) crée une
image (si 8 bits et grey=1 alors niveau de gris)
- void winFreeImage(WinImage ima) libère l'image
- void winPutImage(WinImage ima, int x, int y) affiche
l'image en
, 
- void winSetRGBPoint(WinImage ima, int i, int j,byte
r, byte g, byte b) remplit l'image.
- void winSetGreyPoint(WinImage ima, int i, int j, byte
g) idem niveaux de gris.
Exemple 3
#include <win>
#include <cmath>
int main(int argc, char *argv[])
{
WinImage ima;
int i, x, y, a, b;
winInit(256, 256, black);
ima = winCreateImage(50, 50, 0);
// dégradé de vert
for (a=0; a<50; a++)
for (b=0; b<50; b++)
winSetRGBPoint(ima, a, b, 0, a*256/50, 0);
// On fait tourner l'image
for (i=0; ; i++){
x = 128+50*cos(i/10.0);
y = 128+50*sin(i/10.0);
winPutImage(ima, x, y);
return(0);
}
R Lalement
1999-09-16