• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

Turbo C++ Graphic

I am using Borland C++ 5.02. Can anybody tell me that how to display my initgraph program, since I already specify my bgi folder is in C:\\BC\\BGI and a project is created.
***sorry that i wrongly type the title in "turbo".
0
chengmeng
Asked:
chengmeng
  • 2
  • 2
1 Solution
 
chengmengAuthor Commented:
Edited text of question.
0
 
AlexVirochovskyCommented:
Dou you have BGI example of
Borland? If not,i can send you
(write you EMail).
Next id snippet of code of initialize:
/*                                                                      */
/*      Begin main function                                             */
/*                                                                      */

int main()
{

  Initialize();                 /* Set system into Graphics mode        */
  ReportStatus();               /* Report results of the initialization */

  ColorDemo();                  /* Begin actual demonstration           */
  if( GraphDriver==EGA || GraphDriver==EGALO || GraphDriver==VGA )
    PaletteDemo();
  PutPixelDemo();
  PutImageDemo();
  Bar3DDemo();
  BarDemo();
  RandomBars();
  ArcDemo();
  CircleDemo();
  PieDemo();
  LineRelDemo();
  LineToDemo();
  LineStyleDemo();
  UserLineStyleDemo();
  TextDump();
  TextDemo();
  CRTModeDemo();
  FillStyleDemo();
  FillPatternDemo();
  PolyDemo();
  SayGoodbye();                 /* Give user the closing screen         */

  closegraph();                 /* Return the system to text mode       */
  return(0);
}
/*                                                                      */
/*      INITIALIZE: Initializes the graphics system and reports         */
/*      any errors which occured.                                       */
/*                                                                      */

void Initialize(void)
{
  int xasp, yasp;                       /* Used to read the aspect ratio*/

  GraphDriver = DETECT;                 /* Request auto-detection       */
  initgraph( &GraphDriver, &GraphMode, "" );
  ErrorCode = graphresult();            /* Read result of initialization*/
  if( ErrorCode != grOk ){              /* Error occured during init    */
    printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
    exit( 1 );
  }

  getpalette( &palette );               /* Read the palette from board  */
  MaxColors = getmaxcolor() + 1;        /* Read maximum number of colors*/

  MaxX = getmaxx();
  MaxY = getmaxy();                     /* Read size of screen          */

  getaspectratio( &xasp, &yasp );       /* read the hardware aspect     */
  AspectRatio = (double)xasp / (double)yasp; /* Get correction factor   */

}
Alex
0
 
KangaRooCommented:
Make sure your target platform is 16 Bit Dos. BGI is not supported under Win32 (inlcuding Win32 Console)
0
 
chengmengAuthor Commented:
What do u mean by target platform is 16 bit Dos? How i can make it?
0
 
KangaRooCommented:
When yo create a new project, check out the project dialog. In the lower left area you can select the target type. In the libraries part of the dialog check BGI
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now