...

View Full Version : c program of graphics



tanv@vice
11-16-2008, 06:28 AM
hi...i desperately need a project in C that involves use of graphics..
plz help.. i m a newbie..

mjlorbet
11-16-2008, 07:58 AM
you need an idea for a project or you need somebody else's finished product? what version of c, what compiler are you using, are you looking for a project file for an IDE, and, if so, which one? if you're using borland products (in this day and age i really have to doubt it) but the BGI libraries are what i always used to use, but that was a very, very long time ago. ultimately, you really need to explain what you're looking for a lot better in order to get any useful help.

tanv@vice
11-16-2008, 08:10 AM
since i have to submit the project by tuesday..thr is hardly any time to code it myself...so i m looking 4 some1 who can give me his project idea or clue...i have just begun coding in c and it is really hard 4 me to code specailly graphics tht too animation...i m working on turbo c.plz give ne tips 4 the project.

mjlorbet
11-16-2008, 08:17 AM
the rules of this forum explicitly prohibit us from giving direct answers to homework, much less giving our past projects to use as your assignment. we can, however give you advice and help you with questions you may have in doing your work yourself. also, asking for a graphics based program (which is in and of itself a very vague request) written in turbo c is not something that many people have laying around. i don't think i have any of my projects written in anything before BCPP 4.02 anymore, i doubt many here, or elsewhere, will have anything much older than that still archived. again, i am sorry.

tanv@vice
11-16-2008, 09:02 AM
ya nevr mind...
by the way i tried a program... but it has errors ... some of them r troubling me...can u help me with tht?

mjlorbet
11-16-2008, 09:07 AM
sure, post your code

tanv@vice
11-16-2008, 09:22 AM
(here it is)
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<graphics.h>
#define PATH "c:\tc\bgi\"
void main()
{
int i,j,k,hour,min,g,y=1;
char msg[80];
int gd=DETECT,gm; /* GRAPHICS INITIALIZATION*/
initgraph(&gd,&gm,PATH); /*THE PATH SHOULD BE GIVEN*/
struct dostime_t t; /* GETS THE SYSTEM TIME */
_dos_gettime(&t);
setcolor(14);
sprintf(msg,"The current time is: %d %02d %02d", t.hour,
t.minute,t.second);
outtextxy(150,50,msg);
outtextxy(40,100,"GIVE ONLY THE HOUR AND MINUTE YOU WANT TO SET THE
ALARM(hh,mm)");
outtextxy(97,149,"HOUR:");
gotoxy(19,10);
scanf("%d",&hour); /*GETS THE HOUR AND SECOND TO SET THE ALARM*/
outtextxy(85,198,"MINUTE:");
gotoxy(20,13);
scanf("%d",&min);
outtextxy(485,400,"tanvi");
outtextxy(460,430,"jp UNIVERSITY");
if( t.hour > hour ) goto b;
else if(hour == t.hour && min<=t.minute ) goto b;
else
{
for(i=t.hour;i<=hour;i++)
{
for(j=t.minute;j<60;j++)
{
k=0;
while(k<60)
{
cleardevice();
k++;
setfillstyle(1,1);
bar(510,170,90,230);
settextstyle(1,0,3);
sprintf(msg,"%d %d %d",i,j,k);
outtextxy(230,188,msg);
sound(1000);
delay(100);
nosound();
sleep(1);
if(j==min && i==hour)
{
cleardevice();
while(!kbhit())
{
delay(300);
sound(1000);
setcolor(y);
outtextxy(250,200,"WAKE UP");
delay(300);
nosound();
y++;
}
goto a;
}}}}}
a:
getch();
exit(0);
b:
cleardevice();
outtextxy(250,250,"INVALID TIME");
getch();
}

sanasarwat
01-20-2009, 07:35 PM
hi i am in a desperate need of a code to develop a screen,any screen it could be a welcm pg USING C GRAPHICS ON DOS PLATFORM wil u plz help me out wth d code,n the page should hv three buttons at d botttom as "next ,help n quit"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum