What is the best strategy if I need download image from web and show it in kha?
First of all downloading binary data in haxe is tricky, but I can do this.
So lets say I have raw bytes in some format (jpeg, png...), that I want to show.
Currently there is no way to do this as I can see. Am I right?
Currenly I'm interested in flash, html5, windows, android-native (and possibly ios in future).
I think I can implement this.
- Flash - just use Loader.loadBytes and then kha.Image.fromBitmap
- Html5 - create data url from blob, create image element with this data url, then use kha.Image.fromImage
- Kore - as I can see Kore::Image::Image(filename) constructor code is not very hard to rewrite to accept pointer to raw data instead of file. So it is possible to create constructor Image::Image(u8 *data, int length, char *fileExt) and call it from Image::Image(filename).
This will also allow to load comressed textures on Kore targets...