...

text

Xiang
03-07-2003, 02:49 PM
Dear sir,

In the C program, how can I,

(a) make the text blinking

(b) manipulate the size of the text

(c) manipulate the background color


Thanks

Xiang

Josh Campbell
03-07-2003, 10:28 PM
You'd have to use graphics library.

BloodXero
03-09-2003, 09:29 PM
the first and third you can do with out graphics libraries. the second you do

text way:

1) set up 3 for( ; ; ) statements that contain the rgb values that you will use. increment or set the value each one to a different number and when it gets to a certain value set back to the original 1:


for (r = 0; r < 255; r = 255)
{
if (r = 255)
{
r = 0;
}
}

for (g = 0; g < 255; g = 255)
{
if (g = 255)
{
g = 0;
}
}

for (b = 0; b < 255; b = 255)
{
if (b = 255)
{
b = 0;
}
}


after this you draw the text to the screen and it will flash black and white.

for #3 it would be something like this:


switch(r)
case 0:
r2 = 255;
case 255:
r2 = 0;

switch(g)
case 0:
g2 = 255;
case 255:
g2 = 0;

switch(b)
case 0:
b2 = 255;
case 255:
b2 = 0;


then you draw a primitve rectangle around the text at a point fixed to a certain distance from the text.

the second question of yours i believe must have some special graphics library to do stretching of a animated blinking image with text. if you use C or C++ check out allegro at Allegro (http://www.allegro.cc/). this has a "stretch_blit()" function.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum