Posts

Showing posts from December, 2020

How To Draw Parachute Animation in C Or C++ (Computer Graphics)

Image
                                                                                     PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON PARACHUTE ANIMATION SOURCE CODE: #include <stdio.h> #include <conio.h> #include <graphics.h> #include <dos.h>   int main() {         /* request auto detection */         int gdriver = DETECT, gmode, err;         int i, x, y;         /* initialize graphic mode */         initgraph(&gdriver, &gmode, "C:/TURBOC3/BGI");         err = graphresult();         if (err != grOk) {                 /* error occurred */                 printf("Graphics Error: %s",                                 grapherrormsg(err));                 return 0;         }         x = 50;         y = getmaxy() - 100;         for (i = 0; i < 900; i++) {                 /* drawing the balloon first */                 setcolor(LIGHTRED);                 setfillstyle(SOLID_FILL, LIGHTRED);                 arc(x, y, 0, 180, 40);                

How To Draw Helicopter Animation in C Or C++ (Computer Graphics)

Image
                                                                                                PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON HELICOPTER ANIMATION SOURCE CODE: #include<conio.h> #include<graphics.h> #include<dos.h> //Animation void Helicopter(); void Go(); void main() {   clrscr();   int gd=DETECT, gm;   initgraph(&gd, &gm,"C://TC//BGI");   Go();   Helicopter();   getch();   closegraph(); } //This Go is only to make it stand for some time  void Go(){ //...........     For Background   .........  for(int l=0;l<50;l++){   int b=0;                                      //Speed of y-axis of helicoptor   int c=0;                                      //Speed of x-axis of helicoptor  // Helicopter   line(216+c,235-b,75+c,235-b);   line(115+c,247-b,120+c,240-b);           //UpperBackSmallInclinedLine   line(166+c,247-b,161+c,240-b);            //UpperFrontSmallInclinedLine   line(120+c,240-b,161+c,240-b);                //UpperHorizontallLIne

How To Draw Cosine Wave Animation in C Or C++ (Computer Graphics)

Image
                                                                                          PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON COSINE WAVE ANIMATION SOURCE CODE: #include <conio.h> #include <math.h> #include <graphics.h> #include <dos.h>   void main() {     int gd = DETECT, gm;     int angle = 0;     double x, y;       initgraph(&gd, &gm, "C:\\TC\\BGI");    line(0, getmaxy() / 2, getmaxx(), getmaxy() / 2);  /* generate a sine wave */  for(x = 0; x < getmaxx(); x+=3) {        /* calculate y value given x */      y = 50*sin(angle*3.141/180);      y = getmaxy()/2 - y;        /* color a pixel at the given position */   putpixel(x, y, 15);   delay(100);     /* increment angle */   angle+=5;  }    getch();    /* deallocate memory allocated for graphics screen */  closegraph();    return 0; }

How To Draw Bar Chart Animation in C Or C++ (Computer Graphics)

Image
    PROJECT BY (SIMPLIFY LEARN PROGRAMMING) ON BAR CHART ANIMATION SOURCE CODE: #include <graphics.h> #include <conio.h> int main() {    int gd = DETECT, gm;      initgraph(&gd, &gm, "C:\\TC\\BGI");      setcolor(YELLOW);    rectangle(0,30,639,450);    settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);    setcolor(WHITE);    outtextxy(275,0,"Bar Chart");      setlinestyle(SOLID_LINE,0,2);      line(100,420,100,60);    line(100,420,600,420);    line(90,70,100,60);    line(110,70,100,60);    line(590,410,600,420);    line(590,430,600,420);      outtextxy(95,35,"Y");    outtextxy(610,405,"X");    outtextxy(85,415,"O");      setfillstyle(LINE_FILL,BLUE);    bar(150,100,200,419); outtextxy(160,419,"MI");      setfillstyle(XHATCH_FILL,YELLOW);    bar(225,150,275,419); outtextxy(235,419,"CSK");    setfillstyle(WIDE_DOT_FILL,LIGHTBLUE);    bar(

How To Draw Scenery Animation in C or C++ (Computer Graphics)

Image
    PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON SCENERY ANIMATION SOURCE CODE: #include<iostream.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gd=DETECT,gm,i; initgraph(&gd,&gm,"C:\\TC\\BGI");                         //Write the Path of BGI Folder   //a,b,c,d are used for Translation int a=200, b=-190; int c=200, d=-190;   //x,y,m,n are used for Scaling.   float x=0.5, y=0.5; float m=0.5, n=0.5; for(i=0;i<=500;i++) {   //================================= 3 CLOUDS ===============================// //================================= MIDDLE CLOUD ===========================//   ellipse(200,30,60,240,10,15); ellipse(225,20,345,165,20,15); ellipse(262,27,340,160,20,15); ellipse(268,42,230,50,20,10); ellipse(226,46,163,340,31,15); ellipse(300,21,20,182,21,19); ellipse(325,31,290,100,21,15); ellipse(299,45,228,20,33,11);   //==============================

How To Create CAPTCHA Animation in C Or C++ (Computer Graphics)

Image
    PROJECT BY (SIMPLIFY LEARN PROGRAMMING)    ON CAPTCHA ANIMATION SOURCE CODE: #include <stdlib.h> #include <dos.h> #include<conio.h> #include <graphics.h> int main() {   int i = 0, key, n, x, gd = DETECT, gm;   char a[10];     initgraph(&gd, &gm, "C:\\TC\\BGI");     x = getmaxx()/2;     settextstyle(DEFAULT_FONT, HORIZ_DIR, 5);   settextjustify(CENTER_TEXT, CENTER_TEXT);   setcolor(GREEN);   outtextxy(x, 20, "CAPTCHA");   settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);   outtextxy(x, 125, "Press any key to change the generated \"captcha\"");   outtextxy(x, 150, "Press escape key to exit...");     setcolor(WHITE);   setviewport(100, 200, 600, 400, 1);   setcolor(RED);   randomize();     while (1)   {     while (i < 6)     {       n = random(3);         if (n == 0)         a[i] = 65 + random(26);    /* 65 is the ASCII value of A */       else if (n == 1)         a[i] = 97 + random(26);    /* 97 is the ASCII