Copy link to clipboard
Copied
Hi, I'm currently using the code below to save a screenshot of my app in Flash AIR 2,6:
var cameraRoll:CameraRoll = new CameraRoll();
var bitmapData:BitmapData = new BitmapData(640,960);
bitmapData.draw(MovieClip(root).stage);
cameraRoll.addBitmapData(bitmapData);
The app is working fine, in fact it saves the screenshot in the iPhone's CameraRoll.
So... the question is "what's the problem?": The problem is that the definition of the saved shot is not very high.
It seems like it has got a low JPEG quality... is it possible? Is there a way to save a more defined image in the CameraRoll?
Thank you all
Brandon
Copy link to clipboard
Copied
Could you please send me the the actual stage snapshot(sleep/wake+home button) and the one taken by addBitmapData.
str1=pahup
str2=@
str3=adobe.com
-Thanks
Pahup
Copy link to clipboard
Copied
Hi Pahup, thank you for your reply
You asked me an interesting question: I never compared the iPhone's screenshot (sleep/wake + home button) and the one taken by BitmapData.
They seem identical.
Maybe the problem is connected to my App...
I saw that if my Loader component is small (with a big image loaded) the screenshot has got a very low definition.
If the loader is big, or if the image loaded is small... the screenshot is good.
Have you got any alternative solutions?
Thanks
Brandon
Copy link to clipboard
Copied
I think you should try adding the BitmapData to Camera Roll that you have in memory, instead of try taking the snapshot of the movie clip stage after loading the bitmapdata in a loader.
This way loader wouldn't come play any role.
atleast this is what I understand from your question.
-Pahup
Copy link to clipboard
Copied
Hi Pahup.... I'm not a great AS3 programmer... can you write me a fast sample of what you suggested me?
I'm still an hobbyist newbie programmer
Sorry
Have a nice day
Brandon
Copy link to clipboard
Copied
Brandon,
you might want to paste your code here, I will see if I can help you there.
Code where you use loader with bitmapdata.
-Pahup
Copy link to clipboard
Copied
Hi Pahup, thank you another time for your reply.
The code I'm currently using is that in my main post.
I need something simple... like displaing an image with BitmapData and save it to CameraRoll in High Definition like "Photoshop Express" Mobile app.
Can you help me?
Thank you
Best Regards
Brandon
Copy link to clipboard
Copied
I've developed an Android and iOS app that use the CameraRoll.addBitmapData() method. On my HTC Incredible device, there is a lot of JPEG compression happening when the image is saved. But the image is still compressed on iPhone 4 devices too, but not to the same extent. Note that you should copy the image from the device to your PC to be 100% sure of the image quality, as I understand that sometimes the Android phones show a scaled-up thumbnail, rather than the actual image, when browsing images.
Either way, it would be nice if you could control the CameraRoll API so that the level of compression is configurable, but I don't think this is currently possible.
Copy link to clipboard
Copied
Has this been fixed now? images get compresed really bad and lose a lot of colors.
Copy link to clipboard
Copied
You can now use bitmapdata.drawWithQuality
Copy link to clipboard
Copied
Used that, and got the same results, when saving the image to camera roll colors are lost, or is there a setting i am missing?
Copy link to clipboard
Copied
Did you use it with StageQuality.BEST as the last argument like this myBitmapData.drawWithQuality(mc, null, null, null, null, false, StageQuality.BEST)? I think this also works best with GPU as render mode.
Copy link to clipboard
Copied
at first i didn't, but i did on the next version and it is still the same, i guess the quality issue is when you save the image to camera roll, is there a setting we could use there? taking a screen shot has great quality, compared to the image saved via de camera roll.
Copy link to clipboard
Copied
Hm, it works fine for me. I also set the second last parameter ("smoothing") to true, and I use a rectangle. Like so:
myBitmapData.drawWithQuality(mc, null, null, null, new Rectangle(0, 0, myWidth, myHeight), true, StageQuality.BEST); cameraRoll.addBitmapData(myBitmapData); And I set resolution to high.
Copy link to clipboard
Copied
Here are samples. one is a screen grab and the other one the saved image:
djnr.net/projects/notok.jpg
image ok:
djnr.net/projects/ok.png
you can see how the colors looks washed out on the not ok image, also, the screen grab is saved as png, is there an option to do that? to save to camera roll as png instead of jpg? that should help too
Copy link to clipboard
Copied
I see. Yes the problem might rely to png vs. jpg. As of now it seems it can only be saved as jpg, see this bug report: https://bugbase.adobe.com/index.cfm?event=bug&id=3205096 But the same report mention a workaround.
Copy link to clipboard
Copied
Awesome, thank you very much for your help! i will try this solution they mention., thanks again!
Copy link to clipboard
Copied
Is there a flash as3 based workaround for this?
Copy link to clipboard
Copied
BTW, someone has taken this exact workaround code and implemented a complete ANE for you to use:
Copy link to clipboard
Copied
Was not able to figure this one out, and from what i've read around the forum there is no option to save as png or better quality jpg correct?