ChartJS and OpenFL -- how to create a new Canvas that renders between DisplayObjects?

Here is a trick to do it, you need to create a bitmapdata from the canvas, and then, use it in a bitmap as a displayobject:

bitmapdata.dispose();
bitmapdata= BitmapData.fromCanvas(htmlCanvasElement);
bitmap.bitmapData= bitmapdata;

I used this way to display a canvas as a displayobject, the canvas has even animation, I’ve refreshed the bitmap about 20 times per second, it worked fine with Chrome, but I had an issue with Safari as here BitmapData.fromCanvas on Safari

1 Like