Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: text

  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Malaysia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text

    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

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'd have to use graphics library.

  • #3
    New Coder
    Join Date
    Feb 2003
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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. this has a "stretch_blit()" function.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •