Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nsnarvekar

macrumors newbie
Original poster
Jun 17, 2009
4
0
Hello,

I have one scrollview which contains view which includes the imageview and label.

I want to Pinch in and out that view with the imageview and label.
I am doing it properly. But I also want to to capture the contents of view and send it through mail with the expanded size

Code:
UIGraphicsBeginImageContext(ContainerView.bounds.size);
	
	[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
	
	UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
	
	UIGraphicsEndImageContext();

ContainerView - name of the view
I also replace this ContainerView with the ScrollView.Contentsize
Still not getting any success.:confused:

Any suggestion or code is appreciated

Please help me.
Thanks
 
Maybe this is too late but I had the same problem and solved it. I though I can help by posting the solution here. Just expand your container view before you start any thing. For example if you want to capture the whole scrollview, even off display content, you will need to size your scroll view to match your content size like this:

Code:
self.scrollView.frame = CGRectMake(0, 44, 768, 1024);

And when you are done drawing make sure to resize your scrollview back:

Code:
self.scrollView.frame = CGRectMake(0, 44, self.view.frame.size.width, self.view.frame.size.height);

This was the code I used in my iPad app to capture the scroll view when the device is in landscape mode. The "44" offset was to accommodate for the toolbar at the top. I think you get the idea.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.