Best Graphic Library to draw simple lines but with a lot of points which changes dynamically! (WPF) - wpf

I'd like to know a library to draw graphics in WPF..
I'd like to plot a line graph with a lot of points which increases at runtime..
I tried with DynamicDataDisplay, but it was very slow in my app...
So.. Can you suggest me a library / project to use to solve my problem?
Maaany thanks!

I'd suggest binding your data to a System.Windows.Shapes.Path using a converter, you just need to implement a notifying interface if points are added or removed to update the graph.
(Recently wrote a generic cartesian point array converter for this question)

Related

Curving chart diagram

My goal is to have a diagram which look like this
Each arrow should be a one dimensional chart, where point are displayed (colors and point size depends on some values)
I'm building my own chart system because I spent a few hours looking for one which allow to custom markers (size and colors, and maybe even shape) but I couldn't find one.
Actually the only one I found is dynamic data display 2.0 which is only proposed in Silverlight.
My biggest problem is the two curving chart I have to do at the top of the diagram.
I tried to use PathListBox control, but because it's a listBox, I couldn't display items at fixed X position (like using a chart).
I'm not asking for a full perfect solution, but can someone give me advices, or clues ?
How would you manage to do something like that ?
It should only be a XAML work here, because all the data are already ready in a ListCollectionView (i'm using MVVM).
Thank you !

Render graphics in C to VB control

I have written my own software pipeline for 3D graphics in C (just to prove to myself I could do it) and, having seen it work, I want to use it in DLL form as a library for Visual Basic .NET. I have had good success with mixing C and VB in this way in the past (C does the hard work in a DLL, VB looks pretty), but what I want to do now is a little different. My software renderer needs to display the graphics in a VB form, most likely on a panel. Ideally, I would do one of two things. First, I could create an instance of a Bitmap class in Visual Basic, somehow pass a pointer to the pixel array to a rendering function in C, then paint the bitmap to the panel. Or second, I could somehow control the graphics on the panel more directly, but I'm not sure how that would work. Does anybody know how I could accomplish my goal?
Edit:
Up to this point I have been using SDL to display graphics.
I believe I may have found what I am looking for here.
http://msdn.microsoft.com/en-us/library/5ey6h79d.aspx
I will come back with more information as soon as I try my plan out. Basically, I can get the address of the pixel array for a bitmap with the lock bits method. I can pass this to my C rendering function. It should work perfectly.

How to do simple shape drawing in GTK?

I am new to Gtk and want to do simple drawing of shapes like circles and rectangles. I was looking at the gnome tutorial and the hello word example. However the curves section is undocumented. I was wondering if someone could point me in the right direction as to what should I look at, and maybe if I need to include some other supplementary library to draw?
The preferred drawing API in GTK 2 and 3 is Cairo. But if you need to develop a diagram program, with nodes that can react to events, you will need also to use a canvas, like GooCanvas.
Check out http://developer.gnome.org/gtk3/3.2/GtkDrawingArea.html about the GtkDrawingArea, plus http://developer.gnome.org/gdk/stable/gdk-Drawing-Primitives.html about Gdk-Drawing-Primitives and you are on the go.
You might also go a bit further by using this link and check out Cairo directly http://www.cairographics.org

2D CAD application in WPF

I'm trying to write an CAD-like application in WPF(.NET 4.0) that needs to be able to display a lot of 2D points/lines. It will be used to display CAD-plans of entire cities with zoom, pan, rotate and point snapping on mouseover.
Right now I purely use WPF. I read the objects from the CAD file draw them into a StreamGeometry, use it as stroke of a new Path and add it to a Canvas, with several transforms.
My problem is that this solution doesn't scale well enough. It works fine with small CAD-files, but when I want to display like half a city(with houses and land boundaries) it is very very delayed.
I also tried to convert my CAD-file to an image, but
- a resolution a 32000x32000 is sometimes not enough
- when zooming out the lines are too thin.
In the end I need to be able to place this on a Canvas(2D/3D) as background.
What are my best options here?
Thanks,
Niklas
wpf is not good for a large 3d models. im afraid it is too slow. Your best bet is direct 3d or openGL
However, even with the speed of direct3d,openGL you will still need to work out how to cull as many polygons/vertices as possible before the rendering of the scene if you are trying to show an entire city.
there is a large amount of information on this (generally under game development)
there are a few techniques including frustrum culling, near and far plane culling.
also, since you probably have a static scene you may be able to use binary spacial partitioning.
As I understand the subject is 2D CAD system within WPF.
Great! I use it...
OpenGL and DirectX are in infinite loop OnDraw always. The CPU works all the time.
WPF/Silverlight 2D is smart model.
Yes, total amount of elements (for example, primitives inherited from Shape) must be not so much. But how many?
I tested own app (Silverlight). WPF will be a bit faster I hope...
Here my 2D CAD results. Performance is still great. Each beam consists of multiple primitives.
Use a VirtualCanvas like this one from Chris Lovett.

How to build the following visual

I am not a real designer and I would like to know if anyone have an idea how can I build the following visual :
The idea is to get 2 rings where inside I will draw secific number of pie represented as "Interactive shape or button". Base on the number of shape, they should cover the whole circle.
In addition to that, I need to be able to interact with each pie shape, and inside and oustide edge of those shape should be a perfect arc based on the circle diameter.
As I am not a perfect designer, how can I represent this visual ?
I was thinking of using a custom panel but then how to draw each panel shape in order that they gets perfect inside and ouside arc and offer interactivity with each of them ?
Thanks for your help
I would appreciate samples as well
Theres actually a Silverlight tutorial on making something exactly like this.
If you didnt want to use that, you could always do it in javascript. Here's an example using Rapheal js
I would recommend looking into WPF Geometry and how you can create custom controls (such as the Circular Gauge Custom Control over on CodeProject) using said Geometry.
I've never created a control quite like what your suggesting, but I would image you would define some form of area that can contain children and style it so that it forms the circular shape you want. Then, adding interactive regions should be as simple as adding controls to standard containers.
Here's a link to a "generic radial panel that can be used to host any items" which subclasses Panel.

Resources