The following functions compose the Borland Graphics Interface and are usually available for 16 bit DOS applications. Use them to create onscreen graphics with text. They are defined in graphics.h.
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"f:\tc\bgi");
getch();
closegraph(); /* closes down the graphics system */
return 0;
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm,error;
initgraph(&gd,&gm,"f:\tc\bgi");
error = graphresult();
if (error != grOk)
{
printf("Graphics error occurred");
printf("Press any key to halt:");
getch(); /* wait for a key */
exit(1);
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm,error;
initgraph(&gd,&gm,"f:\tc\bgi");
error = graphresult();
if (error != grOk)
{
printf("Graphics error occurred");
printf("Press any key to halt:");
getch();
exit(1);
}
outtext("Welcome to Borland Graphics Interface");
/* output the message */
getch();...
No comments