CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 1999
    Location
    Michigan, USA
    Posts
    29

    Graphicly Impaired

    This is really basic to some, but how do I get a program to draw a figure I have an equation for?


  2. #2
    Join Date
    May 1999
    Posts
    6

    Re: Graphicly Impaired

    Hook the OnDraw event and paint using a Device Context (DC)


  3. #3
    Join Date
    Apr 1999
    Location
    Michigan, USA
    Posts
    29

    Re: Graphicly Impaired

    Hmmm... Do you think you could explain that a little simpler? I am quite new to C++ an am not quite sure what you just said!


  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Graphicly Impaired

    What was stated has nothing to do with C++. It has everything to do with Windows programming. His advice can be used by C, C++, Visual Basic, etc. *Windows* programmers.

    Basically, when you want to draw on a window, you need to get something called a "device context" or DC for the window. When you issue Windows functions that draw circles, arcs, bezier curves, lines, etc., you issue them to the DC. To get a device context for the window, calls such as GetDC() are used.

    Regards,

    Paul McKenzie


  5. #5
    Join Date
    May 1999
    Posts
    6

    Re: Graphicly Impaired

    In windows, when a control wants to display itself, it must "draw" what you will see. The standard controls do this for you (in the old days, you had to do all of your own drawing.) The control knows when to perform this drawing because it is sent a "draw" event from the operating system. To perform this drawing you need a GDI resource called a device context. To find out more, look up OnDraw and device context or DC in MSDN.


  6. #6
    Join Date
    Apr 1999
    Location
    Michigan, USA
    Posts
    29

    Re: Graphicly Impaired

    Thanks very much, both of you, could either of you send me a sample of this, or direct me to one?


  7. #7
    Guest

    Re: Graphicly Impaired

    One way would be to populate a MSGrid control with the x and y values then call the MSGraph control


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured