Coloring in the background of shape rectangle...

This is a discussion on Coloring in the background of shape rectangle... within the C Programming forums, part of the General Programming Boards category; Hi, Can i do something like draw a small rectangle in the console window, lets say, in color red, and ...

  1. #1
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

    Coloring in the background of shape rectangle...

    Hi,

    Can i do something like draw a small rectangle in the console window, lets say, in color red, and then write over the colored area in another color? How can i do that? I've seen other posts using conio.c, do i use it as well? Pls tell me how.

    thnx a lot

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    thats is for pure dos only, you can't in a consol.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Ok, thnx. So, how can i do it in dos?

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    setup a far pointer to 0xb800:0000... then you've got the 80 by 25 by 2 address to your text. i believe it's in the format of 8:4:4 bits [2 bytes per screen location] being ascii_character:foreground_color:background_charac ter... for each of the 80 by 25 text cells... organized in a 2d array [80 being the first dimension] of 2-byte data described above. have at it, and you'll find your way...
    hasafraggin shizigishin oppashigger...

  5. #5
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Sorry, i hav no idea what you talking about. Is there something, maybe a tutorial to do colors in dos?

  6. #6
    Unregistered
    Guest

    Cool colors

    to change the background color in dos

    use : textbackground (1);
    clrscr();

    to change the color of text in dos

    use : textcolor (1);
    cprintf("text");

    change the color by changing the # in par.(*);

  7. #7
    Unregistered
    Guest

    Re: Coloring in the background of shape rectangle...

    At least don't use conio.c, there would be further problems. There is a better solution in thread "coulor of text" or something, you find it if you search for textcolor or such. But *please* say whether it solved your problem, so one would know what advise to give.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie- having trouble with functions
    By bnmwad in forum C Programming
    Replies: 7
    Last Post: 02-22-2005, 04:41 PM
  2. Tetris Questions
    By KneeGrow in forum Game Programming
    Replies: 19
    Last Post: 10-28-2003, 11:12 PM
  3. Point passed rectangle...
    By Hunter2 in forum Game Programming
    Replies: 15
    Last Post: 10-10-2003, 10:57 AM
  4. Help With pointers in classes.
    By indigo0086 in forum C++ Programming
    Replies: 12
    Last Post: 10-10-2002, 03:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21