0

I'm developing a heat-map (or rather heat-scatter-graph tool) tool for a popular game. I'm quite new to WPF, and I'm at the point where I need to draw thousands of points in my Canvas in WPF and trying to find the best approach to do so.

Each point has few properties: X,Y coordinates and Color in ARGB (alpha based on heat-value, monochrome rather than multi-color).

So far my idea is to have a method which takes in coordinates and A,R,G and B values and adds an ellipse to the children objects of the canvas. It doesn't seem like the most inventive option, so I want to ask if someone knows of a better way to do what I'm trying to do.

  • depends on business requirements of your program, you might look into *raster image* support inside `WPF`. Where the drawing of the vaste amount of color information is significantly faster, but features, like for example, zooming, might require more work and computational power. – Tigran May 03 '17 at 18:02
  • Relevant: http://stackoverflow.com/q/2053288/656243 – Lynn Crumbling May 03 '17 at 18:02
  • Are you opposed to using a library? There are tons of charting libraries that handle this well without you needing to re-invent the wheel. – MrZander May 03 '17 at 18:02
  • 1
    In addition to what Tigran says, you may want to take a look at the WriteableBitmap class, and probably also the WritableBitmapEx library. – Clemens May 03 '17 at 18:07
  • I do have a zoom and pan feature implemented already, which I would rather keep. As for a library, I could definitely take a look, as long as it useful for what I'm trying to achieve (simple blue and red dots with varying alpha). Thanks for the answers! – Ivan Yancheff May 03 '17 at 19:28

1 Answers1

0

You can refer this article written by Charles Petzold - where he explains how to use The DrawingVisual Solution to do the same, while ensuring high performance.

Sharada Gururaj
  • 13,471
  • 1
  • 22
  • 50