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
| #include <stdio.h>
#include <graphics.h>
void start_graph(void)
{ int driver, mode ;
detectgraph(&driver, &mode) ;
initgraph(&driver, &mode, "\\TURBOC\\BGI") ;
}
void main(void)
{ struct arccoordstype draw_arc ;
start_graph() ;
/* Dessine un Arc */
arc(getmaxx()/2, getmaxy()/2, 20, 160, 50) ;
/* Retourne les informations sur l'arc dessiné */
getarccoords(&draw_arc) ;
getch() ;
closegraph() ;
printf("Arc x y\n") ;
printf(" Centre (%d,%d)\n", draw_arc.x, draw_arc.y) ;
printf(" Positions de départ (%d,%d)\n", draw_arc.xstart, draw_arc.ystart) ;
printf(" Positions de fin (%d,%d)\n", draw_arc.xend, draw_arc.yend) ;
printf("Nota : Arc dessiné de la droite\n vers la gauche.\n") ;
getch() ;
} |
Partager