Reputation: 3803
I want to know how can I generate a heatmap on a canvas in WPF (.NET)
I have an array of points (coordinates) with the color intensity, with these data I want to create something similar to this
But, I found that there is no tutorial or library to generate them on a canvas..
Upvotes: 1
Views: 3490
Reputation: 1649
I am very sorry, but you have it wrong. WPF canvas is a sandbox for higher level objects, not points. So there are rectangles, circles, ellipses, lines, polylines etc, but more you put in, slower it gets. Now an image like an heat map could use tens of thousands points or even millions of points and that would be a pretty bad idea to play with it directly in canvas. For this kind manipulation, you need pixels to play with and it means special kind of container, like WritableImage. Please look on the link.
This kind container/class is capable manipulate efficiently with pixels, and that is the way it should be done.
Please note, that there are multiple kinds of bitmap containers for WPF.
Upvotes: 1