Loading resources from normal path/web address

Monkey Forums/Monkey Programming/Loading resources from normal path/web address

jondecker76(Posted 2012) [#1]
I'm just starting to get acquainted with Monkey, and I'm very surprised that there is no way to load an image from the filesystem or a web address. For example, what if I wanted to create a nice slideshow photo gallery html5/Flash app for my web page that loads and displays images in a certain path... This is currently impossible, and I think it is badly needed (I do a lot of web work and I was hoping that Monkey would fit this role as well, but without this it is very limited for general web development)

Any pointers or ideas how this can be implemented? It should definitely be implemented for all targets where possible!


Aman(Posted 2012) [#2]
I agree with you. I created a topic about awhile ago looking for a solution for this problem. But for mobile platforms.


Supertino(Posted 2012) [#3]
Could this not work? http://www.monkeycoder.co.nz/Community/posts.php?topic=137&


Leos(Posted 2012) [#4]
Couldn't you just have folders inside the 'data' folder for that? And use the ajax module above to retrieve your images paths... I managed to make a kind of a image menu that way. Maybe it's close from what you want.


Snader(Posted 2012) [#5]
Leo, can you give some example of how you did that?


Gerry Quinn(Posted 2012) [#6]
I think you should probably be able to get LoadURL() working in Flash with a minimum of native code. I was able to do it for text files and I haven't a clue about ActionScript. Images are a little harder but I imagine not too much so.


Snader(Posted 2012) [#7]
I actually need this for Android in particular. I found some code on the Adroid SDK, but I have no clue how to get this working in a user module.


MonkeyPig(Posted 2012) [#8]
Here's some Android code to load a Bitmap from a url...



It might/might not help you get started.

I didn't get as far as accessing the image from Monkey Side. Just loading resources from URL to use in Android Native UI code - Monkey driving the switching on/off the Android Native UI.


jondecker76(Posted 2012) [#9]
Now that we have read/write pixels and binary data loading - has anybody worked on the ability to dynamically load an image from a path/web address? Seems like the the only thing needed would be to:

- Load the image as binary data
- decompress to RGBA
- write pixels to a created image

Anybody have any ideas how the decompression stage would work?

Thanks!


dragon(Posted 2012) [#10]
Anybody have any ideas how the decompression stage would work?


I think it is not possible to load a image from databuffer in Monkey.
I had same problem here:
http://www.monkeycoder.co.nz/Community/posts.php?topic=3583

But i believe native API can load image from buffer (Android) - but not all Targets (HTML).


Or you write your own PNG/JPG Loader (not so easy)


Skn3(Posted 2012) [#11]
http://www.monkeycoder.co.nz/Community/posts.php?topic=3577

Not quite what your talkin about but Its a good proof of concept.


marksibly(Posted 2012) [#12]
Hi,

This is coming soon...

> Here's some Android code to load a Bitmap from a url...

Thanks! I'll be using that...


dragon(Posted 2012) [#13]
thank you mark!


Snader(Posted 2012) [#14]
Thanks Mark!