draw a curve on a X-Y axis

C

Chi Tang

Hi,

I need to draw some curves on a X-Y axis which is on my windows forms' tab
control. Do I need to draw the X and Y axis first? How to specify a point
on the tab? What GDI+ I need to use or any samples available? Thanks a lot
for any help.

CT
 
M

Morten Wennevik

Hi Chi Tang,

Well, there is Graphics.DrawCurve and it includes a small sample.
Unless you want the upper left corner to be origo you need to
translate each point in relation to the X-Y axis.

http://msdn.microsoft.com/library/d...fsystemdrawinggraphicsclassdrawcurvetopic.asp

If you draw an axis on the tab, each point on the curve will have to
move equivalent of the difference between origo of that axis and the
left border of the control and between origo and the top border of
the control.
 
B

Bob Powell [MVP]

The GDI+ FAQ has an article on how to draw text on a reversed Y axis. This
includes demo code to draw the axis and a chart in the more intuitive
origin-at-the-bottom mode.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top