Fast 2D plots on Colibri T20 WCE 7

We are plotting 2D signals on a Colibri T20 in real time, as the data comes from multiple sensors, and need to speed this up.

At the moment we are using .NET/ C# on WCE 7 using classic GDI methods:

“graphics.DrawLines (Pen, Points_vector)”

But this is clearly not fast enough as we don’t get enough fps.

It took us 30 seconds to quickly download the OpenGL from the Toradex Website and run it
to confirm that hardware acceleration is running and capable of beautiful and fast 3D plotting.

Could someone help us suggesting an easy-to-implement way of replacing the statement above by a functionally equivalent call to a method (e.g. using OpenGL?) that is hardware accelerated?

Thank you in advance

Dear @Henry

.NET and fast plotting are somewhat contradictory terms. The DrawLines() function seems to do it pixel by pixel, with a huge overhead.
To gain performance, you should pass your whole data array into the native code world and do the plotting there. There are several options to do this, for example:

  • There might be ready-made plotting libraries around, which you could access from .NET (I didn’t do any research, I just expect such a thing to be available)
  • Pass your data array into a native C function, which does all the plotting to a drawing context
  • Pass your data array into a native C function, which converts the data into a bitmap. Pass the bitmap back to .NET and display the bitmap from .NET.

Using OpenGL is not required, and would most likely lead to a performance decrease: OpenGL works based on 3D triangles. Setting up those triangles might need more performance than directly drawing a 2D line in the native C world.

Regards, Andy

Thanks Andy. Excellent and rapid support, as usual with the Toradex team.