03-23-2011 09:54 AM
All what i am doing is taking device screenshot and sending it as an attachment in email.
but the problem is that the image that comes in attachment is blank.There is no exception in the code.
I have tested it on OS 5.0 and device 8520.This issue comes on device.
here is my code,
PNGEncodedImage image =PNGEncodedImage.encode(email_bitmap);
//create multipart image
Multipart multipart = new Multipart();
SupportedAttachmentPart attach = new SupportedAttachmentPart(multipart, "image/jpeg",""+title+".jpg",by);
//create new message and invoke mail application
Message msg = new Message();
I have tried with both png and jpeg images.
03-24-2011 02:34 PM
Have you tried displaying it on the device to see if in fact the Bitmap is 'empty'
Have you set the permissions correctly so that you can capture screen shots?
03-25-2011 07:27 AM
"no I don't think that bitmap is empty"
I important word here is think. I suggest that you would be best 'knowing'.
The argument that it works on the Simulator holds for the entire chain of events that gets your screen shot down. Somewhere it is breaking on the device. You can display the results at each stage and figure out where. Displaying the results of the screen capture is the obvious place to start isn't it?
03-26-2011 12:23 AM
hi peter debugged the code but there is no exception also display.screenshot returns me non-empty bitmap.
the size of this bitmap is 3kb and it varies according to area painted on the screen.
but when we open the image it is empty.
03-26-2011 03:43 AM
Just what to clarify that this demonstrates that the problem is in the screen capture and not in the subsequent encoding and sending. Can you confirm this please?
The only time I have seen this is when permissions were not set. from memory, I did get a security exception message, but then the screenshot also completed but was empty, and I think all subsequent ones were empty also. But this is from memory. I'm not convinced I got an Exception, though getting an Exception would seem the right thing to do.
a) Delete the application, restart and then re-install and retry, in the hope that this clears the permissions.
b) Create a simple screen capture program and install it on the device to test with a different program.
Sorry I can't be more helpful.
12-10-2012 10:43 AM
I have the same problem with different devices.
9790 (OS 7): ok
9810 (OS 7): ok
9800 (OS 6): only the first screenshot is empty
Bold 9000 (OS 5) device one: only the first screenshot is empty
Bold 9000 (OS 5) device two: screenshot is always empty
Bold 9700 (OS 6) device one: only the first screenshot is empty
Bold 9700 (OS 6) device two: screenshot is always empty