Slt!
es ce que quelequ'un peut m'aider avec la bibliotheque "graphics.h" je cherche a achuré une surface limité par une ligne!
Version imprimable
Slt!
es ce que quelequ'un peut m'aider avec la bibliotheque "graphics.h" je cherche a achuré une surface limité par une ligne!
"graphics.h" n'est pas une bibliothèque mais un fichier d'entête, maintenant, dire à quel bibliothèque il appartient, seul toi peut le dire.
le header "graphics.h" est un antique header fourni par Borland il y a de cela très longtemps...
Cela n'est même plus supporté...
:google: http://www.cs.colorado.edu/~main/cs1300/doc/bgi/
Il faut apprendre à utiliser un moteur de recherches...
graphics.h est l'interface de la biblio BGI qui se trouve dans Borland turbo C++ .
tiens voici un petit exemple8-)
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<graphics.h> #include<dos.h> void graph(); void souris(); void msg(int); void main() { graph();setbkcolor(1); setfillstyle(1,8); bar(260,100,360,120); outtextxy(280,107,"click me"); souris(); } void souris() { _AX=0; geninterrupt(0x33); //initialisation _AX=7; // nø de l'interruption _CX=5; _DX=634; // Xmin & Xmax geninterrupt(0x33); _AX=8; // nø de l'interruption _CX=5; _DX=475; // Ymin & Ymax geninterrupt(0x33); _AX=1; geninterrupt(0x33); //Affichage du curseur _AX=4; //nø de l'interruption _CX=78; //X initiale du curseur _DX=100; //Y initiale du curseur geninterrupt(0x33); do { do { _AX=3; //coute permanente d'un ventuel click geninterrupt(0x33); }while(_BX==0); if(_BX==1) //click sur le boutton gauche { if((260<_CX&&_CX<360)&&(100<_DX&&_DX<120)) {sound(600);msg(3000);closegraph();exit(0);} } }while(1); } void msg(int tmp) { setbkcolor(0);setfillstyle(1,4); bar(130,200,500,250); outtextxy(165,210,"Une erreur gnrale s'est produite"); outtextxy(145,230,"arrt du systme dans quelques secondes ..."); delay(tmp); setbkcolor(3); nosound(); setfillstyle(1,9); bar(130,200,500,250); outtextxy(145,230,""); outtextxy(145,210,"Eviter de clicker n'importe o Mr Programmer !!!!"); outtextxy(165,230,"c'tait une blague !bonne programmation"); delay(tmp-1000); } void graph() { int gdriver=DETECT , gmode, errorcode; initgraph(&gdriver, &gmode, ""); errorcode = graphresult(); if (errorcode != grOk) { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } }