Win32 controls for drawing

Discussion in 'Win32' started by tailhook123, May 24, 2007.

  1. tailhook123

    tailhook123 New Member

    Joined:
    May 23, 2007
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    I'm looking to draw a picture on a dialog box. Its simply going to have lines on it. By my understanding of what i'm reading I can only draw on a control. Which control would be proper for this task?

    Once I have the control I think from the documentation I create a Graphics object.. then a Pen... and I use the various Draw functions with the pen to then graphiti it up. But what would be the proper base control to place on a dialog box?

    Also.. I try creating a pointer to a Graphics object in a Visual Studio win 32 application but it doesn't recognize it.. is there a library I need to include to bring this online? MSDN just gives the call setups but not the library includes. Thanks.
     
  2. tailhook123

    tailhook123 New Member

    Joined:
    May 23, 2007
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Ok.. I've figured out some stuff. Found that I can draw stuff directly on the dialog box via the WM_PAINT event of the dialogue box. I've been able to put text right on the dialog box via the DrawText call. But it appears in order to put something like a line I need to create a Graphics object using the device context. The problem still arises that I can't get visual studio to recognize the Graphics call. I.e. just a simple:

    Graphics *g;

    Now.. this seems a clear cut library issue. In the MSDN documentation I've found it shows the following:

    Header : Declared in Gdiplusgraphics.h, include gdiplus.h
    Import library : gdiplus.lib

    I've tried including both header files but that just brings up a slew of more errors on the compile. Is there a place in the IDE for adding in the gdiplus.lib and do i need to add the headers to the Header Files over on the left and not just #include "" them?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice