Re: UIScrollView to UIImage
Re: UIScrollView to UIImage
- Subject: Re: UIScrollView to UIImage
- From: Cody Garvin <email@hidden>
- Date: Sun, 21 Jul 2013 12:39:17 -0700
Hi Trygve, sorry for the misinformation earlier.
I wanted to follow up and let you know this is indeed working for me. Forgot to follow up Friday, so sending today.
A few things.
A) Are you adding the QuartzCore framework to your project (I don't believe you'd be able to compile if you weren't), so I think you're good there.
B) Make sure your layer / view isn't nil. Are you using an outlet? Make sure your outlet is connected.
- Cody
Cody Garvin | Developer
Servalsoft LLC
On Jul 17, 2013, at 6:56 PM, Trygve Inda <email@hidden> wrote:
> I am trying to take a "snapshot" of my UIScrollView and store it in a
> UIImage:
>
> UIGraphicsBeginImageContext(scrollView.bounds.size);
> [scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];
> UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
> UIGraphicsEndImageContext();
>
>
> This works for the most views, but when I try it with the UIScrollView, I
> just get a black image (but [image size] is correct).
>
> Any ideas?
>
> Trygve
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden