Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 15:11pm
Edited 31-Mar-13 15:27pm
v2
Comments
ThePhantomUpvoter at 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 at 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 at 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 at 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 at 31-Mar-13 21:03pm
   
Didn't you put this comment by mistake? The question has nothing to do with serial port?
—SA
ThePhantomUpvoter at 31-Mar-13 21:11pm
   
He has changed the "question" since posting. The original included serial port.
Sergey Alexandrovich Kryukov at 31-Mar-13 21:15pm
   
It all look like yet another case where all answers are pretty much useless...
—SA
Ahmed Osama at 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 at 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.
—SA
Ahmed Osama at 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
Sergey Alexandrovich Kryukov at 1-Apr-13 13:19pm
   
I already answered, please see.
—SA

1 solution

Rate this: bad
good
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: 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
  Permalink  
v2
Comments
Ahmed Osama at 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 at 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 at 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 at 1-Apr-13 17:13pm
   
No problem at all. These controls are applicable to Forms, so you can use them.
—SA
Sergey Alexandrovich Kryukov at 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
Ahmed Osama at 2-Apr-13 8:51am
   
Sergey
Thanks so much for your help
and I am so grateful to you
Sergey Alexandrovich Kryukov at 2-Apr-13 8:56am
   
My pleasure.
Good luck, call again.
—SA
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
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 329
2 BillWoodruff 210
3 Afzaal Ahmad Zeeshan 204
4 CPallini 185
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2014
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