Get image data with openfl legacy?

I need to retrieve some image data with openfl legacy.

With lime, I would do:
var img = Assets.getImage(url);
var wanted =;

with nme:
var img = Assets.getBitmapData(url);
var wanted = new UInt8Array(nme.display.BitmapData.getRGBAPixels(img));

But with openfl, I don’t know how to achieve it as openfl do not have any Image class (unlike lime) and its BitmapDataclass do not have a getRGBAPixels() function either

If i am asking this, this is because it do not seem to be possible to access lime from openfl legacy anymore (when I compile with the -Dlegacy flag, the compiler do not enter into #if lime conditionnal flags and do not recognize any lime class anymore (whereas it was working with previous versions of lime if I am not mistaken))

It appears that openfl.display.BitmapData also have a getRGBAPixels() function (I don’t know why it wasn’t proposed by flashdevelopp autocompletion…)
I don’t know how to delete this topic wich is uselss though (if an admin could do it would be great).

There’s a little “…” next to your post. Clicking it will make a trash can appear, which should let you delete the post.

That said, I think the right thing to do is mark this as solved and leave it. Someone else might have the same problem in the future.

You can also do something like…

#if openfl_legacy
// getRGBAPixels
// use bitmapData.image for Lime API access

to support both