Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to know what classes are used to draw functions (like sine , exponential ,... etc)
and I need to know how can I deal with its methods ??

please try to illustrate in details

thanks very much
Posted
Updated 31-Mar-13 14:27pm
v2
Comments
[no name] 31-Mar-13 20:14pm    
For the serial port interface, my guess would be that you could use the SerialPort class in the .NET framework.
There is plenty of drawing support built in too.
Ahmed Osama 31-Mar-13 20:46pm    
thanks a lot
I will look for this one
but if you can give me more details I will be so grateful
[no name] 31-Mar-13 21:13pm    
More details about what? There are tons of drawing classes, articles and tutorials out there. What have you tried to do for yourself?
Ahmed Osama 1-Apr-13 12:13pm    
what I meant if you know more about the methods in this class that I can specifically search for.
or something that you have worked with before so you can tell me a little about your experience
that's all
Sergey Alexandrovich Kryukov 31-Mar-13 21:03pm    
Didn't you put this comment by mistake? The question has nothing to do with serial port?
—SA

1 solution

This is not quite a correct answer, because APIs are not designed like that. It all depends on your application type. You need to learn the ways or rendering and presenting graphics in general.

In particular, you can consider Microsoft Chart Controls: http://msdn.microsoft.com/en-us/library/dd456632.aspx[^].

[EDIT]

Thank you for clarification. In this case, Microsoft Chart Controls can help you.
However, I suggest you first learn how GDI+ graphics rendering works with Forms. Basically, you use System.Drawing.Graphics; the rendering is done in an overridden method System.Windows.Forms.Control.OnPaint or a handler of the event System.Windows.Forms.Control.Paint, modification — via System.Windows.Forms.Control.Invalidate:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onpaint.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.paint.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invalidate.aspx[^].

Please see also my past answers to related questions:
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
How to speed up my vb.net application?[^].

If you have further questions, you are welcome to ask them.

—SA
 
Share this answer
 
v2
Comments
Ahmed Osama 1-Apr-13 12:19pm    
thanks for your solution
but
I didn't say that I want to draw charts
I wanted to draw mathematical functions like sine , exponential or linear functions
( like I have said in the question )
and more important I care the most about how to plot some points and connect them to draw a random function
Sergey Alexandrovich Kryukov 1-Apr-13 13:16pm    
Ahmed,

I can read and paid enough attention for your question; so I noticed that you want to graph some functions, that's why I advised Microsoft charts; this kind of graphics is also often called "charts".

It looks like you are using wrong approach; you should not search for something which someone would create specially for you; this is no how things work. You need to learn how graphics is made in principle; and you did not yet tag the UI library you want to use (meaning WPF, ASP.NET, Forms, what?). It's worthless to discuss the issue further until you learn at least the basics related to UI/graphics development, at least enough to be able to discuss different approaches.

—SA
Ahmed Osama 1-Apr-13 16:59pm    
I am sorry Sergey
I didn't answer your question about the UI
I am going to use Windwos forms application
Sergey Alexandrovich Kryukov 1-Apr-13 17:13pm    
No problem at all. These controls are applicable to Forms, so you can use them.
—SA
Sergey Alexandrovich Kryukov 1-Apr-13 17:19pm    
Please see my updated answer, after [EDIT].
If it gives you the idea on how to do graphics, please accept the answer formally (green button).
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900