Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Capture screen into Bitmap object — Gideros Forum

Capture screen into Bitmap object

RickyngkRickyngk Member
edited May 2012 in Code snippets
Dear all,

I'd like to capture screen to a bitmap object, Or function to convert a Sprite object to Bitmap object (something like RTT).
Would you please help know some clues!

Regards,

Comments

  • @Rickyngk, A few weeks ago I created a plugin for IOS that will most likely do what you want. It's mentioned in this thread:

    http://www.giderosmobile.com/forum/discussion/972

    Sadly, if you're planning on using Android, I don't have a solution just yet.

    Best regards

    Likes: Rickyngk

    +1 -1 (+1 / -0 )Share on Facebook
  • DaleDale Member
    edited September 2012
    Hey, @bowerandy, thanks for this plugin (and the others!).

    I was just attempting to use it (with the demo lua code) with the 2012.8.1 build (using GiderosiOSPlayer running from XCode), and it seems to be throwing an exception on this line:

    UIImage *answerImage= [newUIImage rotate: self.orientation];

    I dragged to the UIImage+* files to the XCode plugins folder; is that the right thing to do with them?

    (When I try to debug, and set a breakpoint at UIImage rotate:, the code never reaches the breakpoint, but throws an exception. So it almost seems like the rotate: method isn't being found.)

    Any ideas?

    Thanks,

    -d
  • Hi @Dale,

    Yes, I had this very same problem when upgrading to 2012.8.1. It is caused by the fact that the protocol only modules (UIImage+Alpha, UIImage+RotScale and UIImage+Resize) are not being linked into the executable and the @rotate: selector is therefore not implemented in the final executable. I think that the new version of the player is built with a different compiler from the last one and this is causing modules with only protocol definitions not to be pulled in for whatever reason.

    The good news is that it can be fixed because I'm using a fixed version now.
    The bad news is I've forgotten exactly how I fixed it (I really should write everything down in future).

    I think the first thing to check is that when you drag the UIImage+ files to the project, and the dialog pops up, you have the appropriate target checked. Try removing the files and re-adding them to do this.

    If this doesn't work, another thing you could try is to move all the UIImage+ files to the top of your Plugins folder in Xcode (i.e. before BhSnapShot.mm).

    Let me know if you can't get it working and I'll have another think.

    Best regards

  • The good news is that it can be fixed because I'm using a fixed version now.
    The bad news is I've forgotten exactly how I fixed it (I really should write everything down in future).
    I can so relate to that, it's almost like, no biggie, I can always get that done, after a while, How did I ever do that...
    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
  • alexzhengalexzheng Guru
    edited September 2012
    Hi @Dale,

    Yes, I had this very same problem when upgrading to 2012.8.1. It is caused by the fact that the protocol only modules (UIImage+Alpha, UIImage+RotScale and UIImage+Resize) are not being linked into the executable
    Is that caused by ..., I just can not remember where is the docment now, just as apple stated there is a linker bug prevent from loading categories only objects from the static lib, try add -all_load.

  • @alexzheng, yes that is the bug that causes the issue so that flag will probably work. However, that isn't the solution I ended up with because the flag isn't in my build process.

    Best regards
Sign In or Register to comment.