DEV/DEV1.1/TP13/quartdepilepsie.c

36 lines
596 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;
2022-12-08 16:44:49 +01:00
fread(&x,sizeof(int),1,f);
fread(&y,sizeof(int),1,f);
2022-12-08 16:44:49 +01:00
InitialiserGraphique();
CreerFenetre(10,10,x,y);
2022-12-08 16:44:49 +01:00
fseek(f,(sizeof(unsigned long int)*768*(1024/2)),SEEK_SET);
2022-12-08 16:44:49 +01:00
for(int i=1024/2;i<x;i++)
{
2022-12-08 16:44:49 +01:00
fseek(f,(sizeof(unsigned long int)*(768/2)),SEEK_CUR);
2022-12-08 16:44:49 +01:00
for(int j=768/2;j<y;j++)
{
fread(&c,sizeof(unsigned long int),1,f);
ChoisirCouleurDessin(c);
DessinerPixel(i,j);
}
}
Touche();
FermerGraphique();
}