Hallo zusammen
Ich habe ein Problem, dass sich zunächst ganz einfach anhört (vielleicht ist es ja auch einfach) allerdings habe ich mir die Zähne daran ausgebissen:
Ich möchte einfach eine Linie von A(x,y) nach B(x,y) auf dem Bildschirm zeichnen und das unter WINDOWS! Denn genau da liegt das Problem. Es gibt ein Hilfe Programm zu dem Befehl „line“:
#include
#include
#include
#include
int main(void)
{
/* request autodetection */
int gdriver = DETECT, gmode, errorcode;
int xmax, ymax;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, „“);
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) { /* an error occurred */
printf(„Graphics error: %s\n“, grapherrormsg(errorcode));
printf(„Press any key to halt:“);
getch();
exit(1);
}
setcolor(getmaxcolor());
xmax = getmaxx();
ymax = getmaxy();
/* draw a diagonal line */
line(0, 0, xmax, ymax);
/* clean up */
getch();
closegraph();
return 0;
}
Allerdings kommt dann der Fehler:
Graphics.h(19,52):Error directive:BGI Graphics not supported under Windows
Wer kann mir Helfen diesen Fehler zu beseitigen
Bis dann und vielen Dank im voraus
Achim