#cleardevice
Explore tagged Tumblr posts
Text
Tumblr media
Stay Safe Online
0 notes
codemultiplex-blog · 7 years ago
Text
Text Animation Program using C++
Text Animation Program Using C++ Programming
  #include #include #include #include #include #include #define round(val) (int)(val+0.5)   void main() { int gd = DETECT, gm=100, sx, sy, tx, ty; initgraph(&gd,&gm,"C:\\TC\\BGI"); char text;   void move(int, int, int, int, char);   couttext; coutsx>>sy; couttx>>ty;   outtextxy(sx, sy, text);   move(sx, sy, tx, ty, text); getch(); closegraph();   }   void move(int sx, int sy, int tx, int ty, char text) {   int dx = tx - sx, dy = ty - sy, steps, k; float xin, yin, x = sx, y = sy;   getch();   if (abs(dx) > abs(dy)) steps = abs(dy); else steps = abs(dy);   xin = dx / (float) steps; yin = dy / (float) steps;   for (k = 0; k cleardevice(); x += xin; y += yin; setcolor(15); outtextxy(round(x), round(y), text); delay(50); } }     OUTPUT:  
Tumblr media
Read the full article
0 notes
esatyabca · 7 years ago
Text
Moving car program in C++
Moving car program in C++
Tumblr media
Moving Car Program in C++ This program is written in C++ using graphics to create and move a car. A car is made using two rectangles and two circles which act as tyres of car. A for loop is used to move the car forward by changing the rectangle and circle coordinates and erasing the previous contents on screen using clearviewport, you can also use cleardevice. Speed of car can be adjusted using…
View On WordPress
0 notes
codemultiplex-blog · 7 years ago
Text
Liang Barsky Line Generating Algorithm
Program for Liang Barsky Line Generating Algorithm. */ Title: Line clipping by using generalized line clipping algorithm which uses parametric equation of line Description: Program to clip the line against the window boundary using Liang Barsky Line Clipping Algorithm */ #include #include void main() { int x1,y1,x2,y2,xwmin,xwmax,ywmin,ywmax,dx,dy,k; float p,q,r; float max,min,u1,u2; float xi,xii,yi,yii; int gm,gd=DETECT; //clrscr(); printf("\n enter the starting coordinates of the line segement"); scanf("%d%d",&x1, &y1); printf("\n enter the ending coordinates of the line segement"); scanf("%d%d",&x2, &y2); printf("\n enter the lower left corner of the window boundary"); scanf("%d%d",&xwmin, &ywmin); printf("\n enter the upper right corner of the window boundary"); scanf("%d%d",&xwmax, &ywmax); initgraph(&gd,&gm,"C:\\TC\\BGI"); dx=x2-x1; dy=y2-y1; //cleardevice(); line(x1,y1,x2,y2); rectangle(xwmin,ywmin,xwmax,ywmax); p=-dx; q=x1-xwmin; p=dx; q=xwmax-x1; p=-dy; q=y1-ywmin; p=dy; q=ywmax-y1; for(k=0;k Read the full article
0 notes