Thread: Drawing Rectangles and Text

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    21

    Drawing Rectangles and Text

    Hi,

    I need to draw a rectangle with no color fill and text in the top left corner of the rectangle. I'm trying to use

    Code:
    dc->FillRect(screen_area,&CBrush(HS_BDIAGONAL,RGB(0,255,0)));
    to draw a rectangle and
    Code:
    dc->TextOut(screen_area.left+2,screen_area.top+5,GetLast());
    to draw the text but it gives me errors saying everything is an undeclared identifier. Help would be much appreciated.

    Thanks

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Sounds like there's a problem including all the necessary header files and linking the libraries.

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    21
    can you possibly explain more, what do i need to do in the headers in order for it to display the GUI?

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    wrong section cram
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  5. #5
    Registered User
    Join Date
    Oct 2004
    Posts
    21
    im really sorry if this is in the wrong section, where should it go, game programming?

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    there's a section for windows programming....

    (btw, you did remember to put #include <windows.h> right?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  7. #7
    Registered User
    Join Date
    Oct 2004
    Posts
    21
    hmm that doesnt seem to be working however ill move this thread to windows programming

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Moved to windows board

    Nevermind, replies here
    http://cboard.cprogramming.com/showthread.php?t=57824
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. Drawing two or more rectangles on client area.. HELP!
    By csonx_p in forum Windows Programming
    Replies: 2
    Last Post: 05-12-2008, 01:43 AM
  3. GDI Drawing Help
    By The Brain in forum Windows Programming
    Replies: 3
    Last Post: 10-20-2005, 02:01 AM
  4. Problem drawing Rectangles and Text
    By cram in forum Windows Programming
    Replies: 2
    Last Post: 10-13-2004, 09:51 PM
  5. Black Rectangles in Text Files
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-07-2003, 06:14 PM