Click here to Skip to main content
13,055,047 members (53,168 online)
Rate this:
Please Sign up or sign in to 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 31-Mar-13 14:11pm
Updated 31-Mar-13 14:27pm
ThePhantomUpvoter 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
ThePhantomUpvoter 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?
ThePhantomUpvoter 31-Mar-13 21:11pm
He has changed the "question" since posting. The original included serial port.
Sergey Alexandrovich Kryukov 31-Mar-13 21:15pm
It all look like yet another case where all answers are pretty much useless...
Ahmed Osama 1-Apr-13 12:28pm
I am so sorry for changing the question but I wanted to be more specific
so that the answers will be more valuable to me
now I am so concerning about drawing the waveform I want
or specifically about how to plot some points and connect them together
( I care about the serial port too and my original question included both of them
but I decided to be more specific in my question )
Sergey Alexandrovich Kryukov 31-Mar-13 21:16pm
You need to tag UI library you want to deal with and application type. If you have no idea, tell about it.
Ahmed Osama 1-Apr-13 12:35pm
actually I have asked because I don't know what classes or methods to deal with
I want to deal with something that will work efficiently and can be somehow easily coded
I will be grateful if you could help me plotting some points and draw the mathematical function which they represent
I wish you could help me out
I already answered, please see.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:[^].


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:[^],[^],[^].

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 application?[^].

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

Ahmed Osama 1-Apr-13 12:19pm
thanks for your solution
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

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.

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
No problem at all. These controls are applicable to Forms, so you can use them.
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).
Ahmed Osama 2-Apr-13 8:51am
Thanks so much for your help
and I am so grateful to you
My pleasure.
Good luck, call again.
P.S.: I had to fix the spelling of my name in your posts... :-)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100