03-23-2012 06:06 PM
I used this code as example to add a "take screenshot" feature to my app:
But everytime i test it, it only creates a Blank.png file.
I tried a lot of different combinations, tried to put the class and the function in different files, call the functions from different parts of the code, but nothing seems to happen.
I'm using the VGField Class, Do you think this might be the problem?
What other options do i have to take a screenshot?
Thank you all!!
Solved! Go to Solution.
03-26-2012 07:03 AM
This link helps you:
In this link you will get:
1st Post gives that capture an image from camera and show it in bitmap;
2. capture an image like screen shot; and save it in SDCard;
03-26-2012 01:03 PM
Dear alishaik786, thanks for the useful link.
I checked the code and it was quite useful, but still i'm not able to do what i need/want.
I want the user to be able to take a screencapture / screenshot of the application. With the code of the link I posted, the application "takes the screenshot" (even ask you to give the permissions), but the image it saves is a blank png file insted of the image of the application.
Anyway, thank you for helping and for the time you took to read/answer
03-27-2012 11:56 AM
I might be wrong here, but I believe if you take a screen shot, and the user has not authorized your application for screen shots, you will get a blank Bitmap and the user will be prompted to allow it. the next screen shot will work, assuming the user has allowed it and is not asked again. So try doing it twice!
Does your code work on the Simulator?
03-28-2012 01:15 AM
You are correct, it works the second time you take the screenshot!! Thanks for your answer.
The problem i'm having is this:
1) user presses "take screenshot"
2) Message asking for permission pop-UP
2.2) If you choose to "allow" and "dont' ask again" the screenshot starts working perfectly
2.3) If you choose to "allow" but do not select the "dont' ask again" the next screenshots does not work
How do i add the option that the permission is set as soon as the app is installed?
03-28-2012 02:00 AM
I read a little bit and guess what i need to do is an Application Permissions Manager that pops-up when the application is executed.
Thank you a lot for the information, i'm glad and happy to see the support and share spirit in this community
03-28-2012 04:18 AM
"guess what I need to do is an Application Permissions Manager "
Correct, that will get over the 'first' problem. In addition, if you are not given permission, then you can withdraw the functionality from the applications. You may fund that some users don't want to give you permission or can not, because of the corporate direction.
03-28-2012 04:19 PM
Dear peter_stramge, one again Thanks for the advice,
i'll create a "config" archive, saved in the user's smartphone that will save if the user gave or not the permissions required.
when a user that not granted the permissions try to use the screenshot it will pop a message saying that the permissions are not enough to perform the operation.
I think this is ok,
the screenshot is not a primary function of the application, so if the permission is not granted it is not critical.