bgi

Codeblocks graphics.h not working

倖福魔咒の 提交于 2021-01-28 04:00:19
问题 When I do: #include <graphics.h> It says: fatal error: graphics.h: No such file or directory How to fix this? I'm using codeblocks 16.01 回答1: Using the angle brackets "<>" assumes graphics.h is part of the C standard library. After some research, it appears this file is no longer included in the library. If you wish to continue using this library, you will have to find graphics.h and place it in the same location as your source code. In your source code, you will then write: #include

Generate a “pieslice” in C without using the pieslice() of graphics.h

守給你的承諾、 提交于 2021-01-28 02:07:46
问题 In the BGI library's "graphics.h" header there is a function pieslice in that header file,its syntax is: #include <graphics.h> void pieslice(int x, int y, int stangle, int endangle, int radius); [x,y are the center of the circle,stangle and endangle are the starting and end angles respectively] Can we make a pieslice in C/C++ without using this in-built function of the BGI library.Please help. Tried making it with the help of the lines and mid-point circle generation algorithms. My code so

Graphical functions in C

和自甴很熟 提交于 2019-12-13 13:29:55
问题 Why I see nothing when I run my code ? I use DOSBox. #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <dos.h> #include <conio.h> #include <bios.h> #include <ctype.h> #include <math.h> int main() { int gdriver = DETECT,gmode = 0; initgraph(&gdriver,&gmode,"C:\\TC\\BGI"); struct time t; moveto(5,10); outtext("Hello"); moveto(6,11); outtext("World**strong text**"); moveto(1,24); outtext("Press: 1-About_Author, 2-Current_Time,ESC to EXIT"); closegraph(); return 0; } 回答1: Your

Graphics.h refresh screen

扶醉桌前 提交于 2019-12-13 06:10:44
问题 I made a small program that displays a 3d cube that you can scale on any axis using the arrow keys. Only problem is that im using cleardevice(); for refreshing the cube ( so that there is no "smearing" when scaling the cube ). that works fine its just that every time the cube refreshes using this method the screen goes black for a split second resulting in annoying flickering. Is there a better way of refreshing the screen every time the user changes the cube? I did actually research this but

Adding user-defined color in function putpixel(int x,int y,int color)

扶醉桌前 提交于 2019-12-12 06:48:29
问题 I am trying to add orange color to my graphics code program. I am using putpixel(int x, int y, int color) function to add color. This function is not allowing to me to do so. Here's my code , Please help me to solve this problem #include<iostream> #include<graphics.h> int main() { int gd=DETECT,gm; initgraph(&gd,&gm,NULL); int height,width; height=10; width=75; while(height!=43) { putpixel(width,height,12); //here i want to add orange color width++; if(width==225) { width=76; height++; } }

BGI in computer graphics

六眼飞鱼酱① 提交于 2019-12-12 04:29:17
问题 bgi error graphics not initialised ('use initgraph') This is the error I'm getting. Even after changing the BGI path and other solutions mentioned, I'm unable to overcome! 回答1: The problem isn't that you are looking in the wrong directory, the problem is that the Borland Graphics Interface requires that you call initgraph() before you try to actually draw things. You would expect this to look something like this: initgraph(&gd , &gm ,"C:\\TurboC\\BGI"); The suggestion in the comments, i.e.,

CodeBlocks error in graphics library

安稳与你 提交于 2019-12-08 04:07:13
问题 I executed the following code in codeblocks IDE- #include <iostream> #include <graphics.h> using namespace std; int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\TC\BGI"); line(100, 200, 150, 250); cout << "Hello world!" << endl; return 0; } and while debugging my code stopped at this point in graphics.h int left=0, int right=0, int right=INT_MAX, int bottom=INT_MAX, I have included the WinBGIm library. 回答1: Looks like issue with initialization of graphics driver. What is the output

C++ graphics initgraph error (syntax or missing-file flaw?)

梦想与她 提交于 2019-12-02 00:43:43
问题 [SOLVED] I'm using CodeBlocks (C++) on Win10. I tried to create a simple graphic program - I downloaded a certain graphics package (graphics.h and other two files related to BGI - I added the lib in settings etc.). I tried this program but there seems to be a problem at the line marked. I ported this from Pascal (as my teacher -yes, it's about college-, only shows us Pascal programs) in a correct manner I suppose, or at least partially. The problem is certainly with the pointers (EDIT AFTER

C++ graphics initgraph error (syntax or missing-file flaw?)

懵懂的女人 提交于 2019-12-01 21:46:59
[SOLVED] I'm using CodeBlocks (C++) on Win10. I tried to create a simple graphic program - I downloaded a certain graphics package (graphics.h and other two files related to BGI - I added the lib in settings etc.). I tried this program but there seems to be a problem at the line marked. I ported this from Pascal (as my teacher -yes, it's about college-, only shows us Pascal programs) in a correct manner I suppose, or at least partially. The problem is certainly with the pointers (EDIT AFTER SOLVING: it wasn't!, check my answer). I'll give more details if needed. The Question: Where I did

BGI error, How to Resolve it?

橙三吉。 提交于 2019-12-01 09:12:13
I want to run a C program that draws a circle. The program is compiling with no error and it is running. After getting the values like radius from the user, I get the error like this : BGI error: Graphics not initialized ( use "initgraph") Even though in my source code I have added this line : int gmode,gdrive=DETECT; initgraph(&gdrive,&gmode,"c\\tc\\bgi"); Still I'm getting error. I'm using Windows and I couldn't figure out where I went wrong. Can anyone help me in this regard? Thanks in advance. Jesus Ramos Your path in initgraph is wrong. Use "c:\\tc\bgi" instead. montej I also suffered