Bonjour à tous
j'ai un p'tit probleme avec les getimage et putimage en c ... je ne vois pas pourquoi il n'affiche pas mon putimage dans le main ...
Voici le code
#include <graphics.h>
#define TEMPO 15000
void module_chargement_des_dessins(void *monfantome);
void module_graphique(void);
int Xmax,Ymax,Cmax;
main()
{
void *fantome;
module_graphique();
module_chargement_des_dessins(fantome);
putimage(10,10,fantome,XOR_PUT);
getch();
closegraph();
}
void module_chargement_des_dessins(void *monfantome)
{
int pst_x1, pst_y1, pst_x2, pst_y2;
int unsigned taille;
setcolor(4);
pst_x1=Xmax/2-11;
pst_y1=Ymax/2-11;
pst_x2=Xmax/2+11;
pst_y2=Ymax/2+11;
rectangle(pst_x1,pst_y1,pst_x2,pst_y2);
setcolor(2);
setfillstyle(1,2);
ellipse(Xmax/2,Ymax/2-5,0,180,8,5);
line(Xmax/2-8,Ymax/2-5,Xmax/2-8,Ymax/2+8);
line(Xmax/2+8,Ymax/2-5,Xmax/2+8,Ymax/2+8);
ellipse(Xmax/2,Ymax/2+10,0,180,8,5);
floodfill(Xmax/2,Ymax/2,2);
taille=imagesize(pst_x1,pst_y1,pst_x2,pst_y2);
monfantome=malloc(taille);
getimage(pst_x1,pst_y1,pst_x2,pst_y2,monfantome);
getch();
putimage(pst_x1,pst_y1,monfantome,XOR_PUT);
}
void module_graphique(void){
int gestionnaire = DETECT,mode,test,erreur_graphique;
initgraph(&gestionnaire,&mode,"");
if ((erreur_graphique = graphresult()) != grOk)
{
printf("ERREUR GRAPHIQUE : %s\n",grapherrormsg(erreur_graphique));
getch();exit(1);
}
sleep(2);
Xmax=getmaxx();
Ymax=getmaxy();
Cmax=getmaxcolor();
}
Merci de votre aide à tous
DOS-chkdsk-2K