36 lines
738 B
C
36 lines
738 B
C
|
#include<stdlib.h>
|
||
|
#include<graph.h>
|
||
|
#include<stdio.h>
|
||
|
#include<string.h>
|
||
|
|
||
|
int main(){
|
||
|
FILE *f;
|
||
|
int largeur;
|
||
|
int longueur;
|
||
|
couleur c;
|
||
|
int i;
|
||
|
int j;
|
||
|
f=fopen("image.bin","r");
|
||
|
fread(&largeur,4,1,f);
|
||
|
fread(&longueur,4,1,f);
|
||
|
fclose(f);
|
||
|
InitialiserGraphique();
|
||
|
CreerFenetre(0,0,largeur/2,longueur/2);
|
||
|
f=fopen("image.bin","r");
|
||
|
fseek(f,(8*(largeur/2)*longueur)+8,SEEK_SET);
|
||
|
for(i=0;i<largeur/2;i++){
|
||
|
fseek(f,8*(longueur/2),SEEK_CUR);
|
||
|
for(j=0;j<longueur/2;j++){
|
||
|
fread(&c,4,1,f);
|
||
|
fseek(f,4,SEEK_CUR);
|
||
|
ChoisirCouleurDessin(c);
|
||
|
DessinerPixel(i,j);
|
||
|
}
|
||
|
}
|
||
|
int touche;
|
||
|
while(!ToucheEnAttente){}
|
||
|
touche=Touche();
|
||
|
if(touche==0xff80){
|
||
|
FermerGraphique();
|
||
|
}
|
||
|
}
|