How do I display Cartesian points in a Winforms project?

I am looking for a way to display points on a 2D plane in a C # Winforms project.

Points will be updated 5 times per second. If a given point changes (the number of points is always static), it would be nice to revive them in a new place.

I tried Zendgraph, but it is more graphic oriented.

How to visually display and animate cartesian points in c #?

+4
source share
3 answers

Take a look at this code I just wrote for a working and simple example:

http://0bj3ct1v3.pastebin.com/Xs9DeJ8m

Using:

  • add this class to your project (change the namespace to yours if you want)
  • rebuild solution
  • Now you can see the Plot control among the elements of the designer toolbar.
+1
source

there is a nice old GDI + for basic 2D drawing that you can find in the System.Drawing namespace

Basically you will create a bitmap and using various methods of the System.Drawign.Graphics class, draw shapes / colors / etc on it, then put it in your form either in the PictureBox control, or even in the Background form.

0
source

I don’t know either your knowledge or the technical requirements of your application, but you can think about creating your own animated drawing in a WPF user control and use the ElementHost control to embed the WPF control in your winform application.

You will then take advantage of the WPF animation features in your WPF application.

If you know WPF, this might be a little easier than animating the graphs themselves.

0
source

Source: https://habr.com/ru/post/1339738/


All Articles