Save loaded Image

Monkey Forums/Monkey Programming/Save loaded Image

Ironstorm(Posted 2013) [#1]
Hey folks!

Currently I'm on an app for a client. This app loads a bunch of images from a webserver. And this part works fine. But now I'm trying to save those loaded images on the local device. So the user doesn't have to load them every time from the internet.

Thought this should be easy, but I don't get it. I doesn't even know where to start. I just want to save the loaded image as jpg or png (depends on the loaded file). Is there any way to do this, without having to draw every image and uses of ReadPixel?

Thanks for your help!
Ironstorm


ziggy(Posted 2013) [#2]
That's very platoform specific, and I think it sohuld be done natively. What are your targets?


Sammy(Posted 2013) [#3]
I've not used the networking comands yet but why not download it as a binary file, then just re-save it locally? This will keep the image format intact.


AdamRedwoods(Posted 2013) [#4]
try FileStream.WriteAll(bytebuffer). watch out for endianness.
also, i don't know if you need a file created first. if so, use FileSystem.Create()


rIKmAN(Posted 2013) [#5]
Is that only for GLFW Adam?


AdamRedwoods(Posted 2013) [#6]
it's there for glfw,ios,android,xna


Ironstorm(Posted 2013) [#7]
Yeah, thanks Adam!

Didn't know, that Databuffer has it's own async Load-Function with networking capabilities.

I haven't written any code to show off. Just some quick short tests and it worked. If I'm back on this part I'll write something and post it here.

Again, thanks to you guys.