DEV/DEV1.1/TP13/quartdepilepsie.c

30 lines
586 B
C
Raw Normal View History

#include <graph.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char const *argv[])
{
FILE *f;
f=fopen("image.bin","r");
int x;
int y;
couleur c;
fread(&x,sizeof(int),1,f);
fread(&y,sizeof(int),1,f);
InitialiserGraphique();
CreerFenetre(10,10,x,y);
fseek(f,(sizeof(unsigned long int)*768*(1024/2)),SEEK_SET);
for(int i=1024/2;i<x;i++)
{
fseek(f,(sizeof(unsigned long int)*(768/2)),SEEK_CUR);
for(int j=768/2;j<y;j++)
{
fread(&c,sizeof(unsigned long int),1,f);
ChoisirCouleurDessin(c);
DessinerPixel(i,j);
}
}
Touche();
FermerGraphique();
}