Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-11-2009
Member
 
Join Date: Nov 2009
Posts: 117
Graphics program required in C programming Language

Hi, I am a student of BSC.I.T. and know little bit about the graphics programming as we have Computer Graphics as one subject in our syllabus. But now I want to know little bit more about it. Can you provide me any code in C through which I can get something more knowledge about it. I have basic knowledge about it. Required help to improve it. Please help me.....
Reply With Quote
  #2  
Old 19-11-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Graphics program required in C programming Language

Hi, I am also have same knowledge as you have, as I am also the student of BSC.I.T. But you can get more knowledge about it by using different books on Graphic Design with C. You can also check for it by referring to the Complete Reference of Computer Graphics. You can take a look on different pdf books which are provided on internet and try to solve it. As I don't want to make any improvement in my knowledge I had never try for this.
Reply With Quote
  #3  
Old 19-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Graphics program required in C programming Language

Hi, I am sending you code which draw a space with stars:

Code:
#include<graphics.h>
main()
{
  int d=DETECT,m;
  int i,x,y;
  initgraph(&d,&m,"");
  line(0,0,640,0);
  line(0,0,0,480);
  line(639,0,639,480);
  line(639,479,0,479);
  for(i=0;i<=1000;i++)
  {
    x=rand()%639;
    y=rand()%480;
    putpixel(x,y,15);
  }
  getch();
  closegraph();
}
Reply With Quote
  #4  
Old 19-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Graphics program required in C programming Language

Hi, I am sending you code which will provide you animation of car. This is the program for Car Animation:

Code:
#include<graphics.h>
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<stdlib.h>
void main()

{
int v,s;
int gd= DETECT,gm;
initgraph(&gd,&gm," ");
line(0,290,634,290);
for(int i=10;i<=634;i++)
{
cleardevice();
line(130+i,200,180+i,150);
line(180+i,150,250+i,150);
line(250+i,150,300+i,200);
circle(300+i,275,15);
circle(150+i,275,15);
rectangle(120+i,200,350+i,260);
line(0,290,634,290);
delay(10);
}

for( i=634;i>=0;i--)
{
cleardevice();
line(130-i,200,180-i,150);
line(180-i,150,250-i,150);
line(250-i,150,300-i,200);
circle(300-i,275,15);
circle(150-i,275,15);
rectangle(120-i,200,350-i,260);
line(0,290,634,290);
delay(10);
}
getch();
}
Just check it.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Graphics program required in C programming Language"
Thread Thread Starter Forum Replies Last Post
What are HTA in Programming Language? Silent~Kid Software Development 4 27-02-2010 05:31 AM
Socket programming: Is any new Programming Language? Kushan Software Development 3 14-11-2009 11:13 AM
IDE required for C# programming ANSEL Software Development 3 02-09-2009 07:38 PM
Initial programming required message on verizon phone Bernice Portable Devices 3 04-08-2009 01:01 PM
JABACO programming language Duck Software Development 4 22-04-2009 09:21 PM


All times are GMT +5.5. The time now is 11:20 PM.