Results 1 to 4 of 4

Thread: Graphics program required in C programming Language

  1. #1
    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.....

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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();
    }

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,552,344.38119 seconds with 17 queries