'Adding blink to the color but its not blinking
The text should blink in red color but its not blinking
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main(void)
{
int driver=DETECT,mode,mx,my,x1,y1,x2,y2;
initgraph(&driver,&mode,"C:\\tc\\bgi");
cleardevice();
mx=getmaxx();
my=getmaxy();
settextstyle(0,HORIZ_DIR,6);
setcolor(RED+BLINK);
outtextxy(mx/2,my/2,"FAHAD");
getch();
closegraph();
}
Solution 1:[1]
That code is targeted at 16-bit MS-DOS, the Win32 DOS-box virtualisation does not support the blinking attribute. I believe that it was supported in 'full-screen' mode, but versions of Windows since XP and 2000 do not support full-screen console or DOS-box presentation.
Solution 2:[2]
From your question I have no clue what library you are using, but common sense tells me this could help:
setcolor(RED | BLINK); // Use bitwise or instead of + to combine values
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Clifford |
| Solution 2 | Karel Petranek |
