Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Taking and saving screenshots and thumbnails — Gideros Forum

Taking and saving screenshots and thumbnails

kussakovkussakov Member
edited May 2013 in Roadmap
Hi,

I have a question on the Roadmap:

Are you planning to add ability to save screenshots, thumbnails, etc. any time soon?
What I see in the roadmap is: "Full access to graphics layer". Is this part of it?
Also I found an old discussion about expected "render to texture feature" that is supposed to address this (http://www.giderosmobile.com/forum/discussion/1345/taking-a-screenshot)

The reason I am asking is:
I am trying to decide if I should spend time writing/using Gideros plugins for that or wait for future release.

I have done this in some iOS apps (entire screen, not parts of it) and it is fairly easy to do (get,resize,convert,save).
Does not look hard on Android as well(again entire screen)...
I needed to know before spending time on plugins.


Thanks a lot!

Vlad

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Hello @kussakov ;)
    Well the part that will be able to do that is render to texture. And it will most probably be available even with the beta when OpenGL ES 2 version comes out.
  • So render to texture feature is implemented and it is working.
    But how do I save it to file?
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    @kussakov yes unfortunately we remembered about option saving to file only after the release :(
    Currently I can't come up with any hack or a plugin that could do that, but if I will, I'll certainly post it in the forum
  • OZAppsOZApps Guru
    Accepted Answer
    So render to texture feature is implemented and it is working.
    But how do I save it to file?
    it slipped from the release, so it would work only in the next release. However since there was a minor update I thought it would have been included. BUT I think the next version might be coming soon which would have that and more...
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Thanks for the explanation guys.
    Hope the next release is indeed coming soon :-)
  • With the release of Gideros 2013.09 is saving a texture to a file now possible?

    Likes: JuanZambrano

    +1 -1 (+1 / -0 )Share on Facebook
  • I want to know the same thing.
    It appears to have "slipped from 2013.06 release", and was supposed to come in the next release but I do not see it in the release notes for 2013.09...
    If not when do you expect this to be available?
  • It was more complicated than we anticipated, and probably now will only be with Gideros 2.0
  • kussakovkussakov Member
    edited October 2013
    OK. So if we want thumbnails, etc. we need to write plugins.

    Basically all it is needed is to save a texture data to a file.
    Any pointers?

    For example if I am to pass a texture to a plugin it will be in some user data structure. Can you tell us how to parse this data in order to get the image data from it.
    If I can get the image data from the texture (I guess it is a bitmap) - it will be fairly easy to write a code to convert to PNG/JPG and save.

    Actually I have already done some research by passing a texture to a plugin. I see the binary data, but I do not know how to extract the image from it. The rest is very simple.

    (Do not understand me wrongly - I am not saying that making it part of Gideros is simple, but using iOS and Android SDK on top of it makes it very simple - a few lines of code actually once you have the data).

    Hope you will be able to help us...

    Thanks!
  • hmm, how did you access pass the texture to a plugin, since you don't have access to internal Gideros API through plugin yet?
  • kussakovkussakov Member
    edited October 2013
    I did some simple "test" plugin where I have a test API to pass the texture.

    In the LUA code I just pass it like this. E.g:
    test.testPassTexture(myTexture)

    In the C code of the plugin I treat it as userdata with something like
    void *t = (void *)lua_touserdata(L,1) //(where L is the lua_state *)

    I wanted to see what was there in this memory and if can use it to get the image (bitmap or whatever) from it.
    In the debugger I saw bunch of non 0 bytes, but nothing made sense since I do not know how to interpret the data.
    Of course this may not be the right data at all. Could be that I saw the texture object binary structure only, since the image data does not have to be in this memory block at all (could be in a texture cache).
    That is why I was asking, because I don't know.

    Question:
    You say it is complicated, but how hard it is to add a new function to the RenderTarget class (say "getImage","getBuffer",etc.) that returns data or "string"(since lua strings can have binary stuff) that I can save to the disk or base64 and send to a server).
    Does not need to be resized or anything - just as is.
    Does not need to be jpg or png(even though this is optimal). Even a bitmap or some kind of data buffer will also work (not sure how the textures are kept in the memory) as long as it is known what it is :-).
    Do you see what I mean? This data must be easily accessible internally. No?

    Thank for you help!
  • I see. well about Texture, userdata most probably holds the reference to Texture's cpp instance, which does not contain the binary data itself, but rather hold a reference to it in the cache (because as you know all textures are reused).
    And since you can get it as a void/opaque pointer, unfortunately there is no way to get the bytes through plugin (at least not that I would know of).

    And yes, adding method like getBytes probably is not hard, but for most users it wont do any good, without having the actual image, like png.
    And most probably saving as png will be available in Gideros 2.0
  • OK. So it seems that plugins that get GL buffer are the solution for now :-(

    Just for the record:
    There is a little contradiction here: You say that that it is impossible to get the texture image in a plugin. On the other hand you say it is relatively easy to getBytes, but it will not be useful for most users.
    But having the bytes of a texture I have prepared (contains exactly what I need - rendered to texture image) will allow me to write a simple plugin that will convert it to PNG...
  • I meant it should be relatively easy for us to provide such functionality, not to achieve it through plugin :)
Sign In or Register to comment.