+ 1

What do I do now??? Graphics in C program are flickering...How to stop that???? How to graphics without flicker??

Show me a solution

16th Apr 2019, 1:09 AM
T Harish Kumar
T Harish Kumar - avatar
5 ответов
+ 1
#include<stdio.h> #include<conio.h> #include<string.h> #include<graphics.h> void main() { int gd=DETECT,gm,x,y,n,i=0; char j[100]; clrscr(); initgraph(&gd,&gm,"C:\\TC\\BGI"); x=getmaxx(); y=getmaxy()/4; printf("Enter your Name:"); gets(j); clrscr(); n=strlen(j); settextstyle(4,0,10); i=x; while(i!=-25*n) { outtextxy(i,y,j); i--; clearviewport(); } getch(); closegraph(); }
16th Apr 2019, 10:57 AM
T Harish Kumar
T Harish Kumar - avatar
+ 1
#include<stdio.h> #include<conio.h> #include<string.h> #include<graphics.h> void main() { int gd=DETECT,gm,x,y,n,i=0; char j[100]; clrscr(); initgraph(&gd,&gm,"C:\\TC\\BGI"); x=getmaxx(); y=getmaxy()/4; printf("Enter your Name:"); gets(j); clrscr(); n=strlen(j); settextstyle(4,0,10); i=x; while(i!=-25*n) { outtextxy(i,y,j); i--; clearviewport(); } getch(); closegraph(); }
16th Apr 2019, 10:57 AM
T Harish Kumar
T Harish Kumar - avatar
+ 1
I sadly dont know conio.h and havent worked with graphics.h. But it looks like you are clearing your vieport after you write something. Try clearviewport before the outtexty.
16th Apr 2019, 11:03 AM
Dragonxiv
Dragonxiv - avatar
0
You can look for double buffering to prevent flickering. But there are many reasons why your specific code could flicker. Can you show us your code?
16th Apr 2019, 5:37 AM
Dragonxiv
Dragonxiv - avatar
0
Saree kanukuntaaaa le raa badhapadadhuuu
18th Apr 2019, 3:50 PM
Khadar Royal
Khadar Royal - avatar