How to transfer image object from JS to uno and Foreign Language?

If I have a image file (or image url) open in JS module, or show in the compoment, how can I operate (or transfer) this image object in uno language or Foreign Laguage ?

Thanks!

It really depends. There is no interchangeable image object type per se, but as long as we are talking about a file, all languages can somehow use that.

The question is, what do you want to use the image for?

You could call a Uno function with the URI and then download the image in foreign.

I have a image’s url, and show it in . So I thing the image already download.

If I want to use the uno or Foreign Code to share the image with other application, like save it in the photo album or edit in other application, I can not use the already download data,

I have to save the image to temp file and transfer the file uri to uno, or just transfer the url to uno, and then the uno download the image again.

PS:

How to save a image in JS or uno code ?

If you download in Uno you can save using Uno.IO.WriteAllBytes(string filename, byte[] bytes) see the documentation here https://www.fusetools.com/learn/uno/api/uno/io/file