DEV1.1
TD
TP01
TP02
TP03
TP04
TP05
TP06
TP07
TP08
TP09
TP10
TP11
TP12
TP13
epilepsie.c
exercices_cercles.png
fenetre.c
formes.c
image.bin
quartdepilepsie.c
rebour.c
random
.gitignore
README.md
30 lines
586 B
C
30 lines
586 B
C
|
#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();
|
||
|
}
|