Update:
CGRect rect = [scrollView bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[scrollView.layer renderInContext:context];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
The scroll view's bounds.origin is also its contentOffset, which is likely what
is happening when you render it in to the context.
However, you seem to imply that you just have a simple scroll view with a
simple image inside – why do this at all?
Instead just use the contentOffset to determine
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
You're right Kyle. I quickly tried it, saw it worked and moved on.
I'll try it again another way and report back
Please excuse mobile typos
On Jul 18, 2013, at 1:37 PM, Kyle Sluder k...@ksluder.com wrote:
On Thu, Jul 18, 2013, at 01:18 PM, Cody Garvin wrote:
The UIScrollView adds these
Hi Trygve,
The UIScrollView adds these subviews to what's called a contentView. This is
why you have to change a content size to adjust your scrolling, vs changing the
frame of the UIScrollView. You're grabbing the wrong layer.
You can grab the correct view / layer: [[scrollView contentView]
On Thu, Jul 18, 2013, at 01:18 PM, Cody Garvin wrote:
The UIScrollView adds these subviews to what's called a contentView. This
is why you have to change a content size to adjust your scrolling, vs
changing the frame of the UIScrollView. You're grabbing the wrong layer.
When learning about
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
Does it do that even if the scroll view isn't scrolled at all but is at the
very top?
On 18 Jul, 2013, at 9:56, Trygve Inda cocoa...@xericdesign.com wrote:
I am trying to take a snapshot of my UIScrollView and store it in a
UIImage:
UIGraphicsBeginImageContext(scrollView.bounds.size);
Does it do that even if the scroll view isn't scrolled at all but is at the
very top?
On 18 Jul, 2013, at 9:56, Trygve Inda cocoa...@xericdesign.com wrote:
I am trying to take a snapshot of my UIScrollView and store it in a
UIImage:
UIGraphicsBeginImageContext(scrollView.bounds.size);