Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
GiderosApplication getView() ? - Gideros Forum

GiderosApplication getView() ?

jeromegsqjeromegsq Member
edited April 2015 in General questions
Hello,

I want to make a screenshot of my application. I use JVBridge to make the JAVA code.
I want to know in which view my gideros application is ?

public TakeScreen(Activity self) {
View rootView = self.getWindow().getDecorView().findViewById(android.R.id.content);
rootView.setDrawingCacheEnabled(true);

File imagePath = new File(Environment.getExternalStorageDirectory()+ "/screenshot.png");
FileOutputStream fos;
try {
fos = new FileOutputStream(imagePath);
rootView.getDrawingCache().compress(CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {

} catch (IOException e) {

}
}

Where Activity self is my app Activity


Thank you

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Hello @jeromegsq
    I think that it won't work that way, because Gideros is drawn on GLSurface, and all you will see there is empty GLSurface.

    Unfortunately I don't remember how to fetch exactly needed view, I think what you are getting is the parent of what was set as setContentView

    But I would suggest trying Media plugin to get a screenshot, it should be included in All Plugins folder in latest builds
Sign In or Register to comment.