• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Save images to CameraRoll - iOS

New Here ,
Jul 31, 2011 Jul 31, 2011

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

TOPICS
Development

Views

7.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 31, 2011 Jul 31, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2011 Aug 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 01, 2011 Aug 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2011 Aug 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 01, 2011 Aug 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2011 Aug 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 03, 2011 Aug 03, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 23, 2013 Apr 23, 2013

Copy link to clipboard

Copied

Has this been fixed now? images get compresed really bad and lose a lot of colors.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 23, 2013 Apr 23, 2013

Copy link to clipboard

Copied

You can now use bitmapdata.drawWithQuality

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2013 Apr 24, 2013

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2013 Apr 24, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2013 Apr 24, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2013 Apr 24, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2013 Apr 24, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2013 Apr 24, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2013 Apr 24, 2013

Copy link to clipboard

Copied

Awesome, thank you very much for your help! i will try this solution they mention., thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2013 Jun 10, 2013

Copy link to clipboard

Copied

Is there a flash as3 based workaround for this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 11, 2013 Jun 11, 2013

Copy link to clipboard

Copied

BTW, someone has taken this exact workaround code and implemented a complete ANE for you to use:

https://github.com/katopz/ane-photosalbum

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2013 Jun 11, 2013

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines