Click to See Complete Forum and Search --> : Graphicly Impaired


Chronovore
May 24th, 1999, 03:02 PM
This is really basic to some, but how do I get a program to draw a figure I have an equation for?

brevert
May 24th, 1999, 08:37 PM
Hook the OnDraw event and paint using a Device Context (DC)

Chronovore
May 25th, 1999, 06:08 AM
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! :)

Paul McKenzie
May 25th, 1999, 08:14 AM
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

brevert
May 25th, 1999, 08:23 AM
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.

Chronovore
May 26th, 1999, 06:21 AM
Thanks very much, both of you, could either of you send me a sample of this, or direct me to one?

May 28th, 1999, 11:38 AM
One way would be to populate a MSGrid control with the x and y values then call the MSGraph control