• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: -renderInContext: with multiple layers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -renderInContext: with multiple layers?


  • Subject: Re: -renderInContext: with multiple layers?
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 15 Aug 2011 15:46:12 -0700

On Mon, Aug 15, 2011 at 2:47 PM, Rick Mann <email@hidden> wrote:
> Hi. I have two UIView hierarchies, visually side-by side, but at different parts of an overall view hierarchy. I'd like  to create a single UIImage of the two, using -renderInContext: and UIGraphicsGetImageFromCurrentImageContext(). I was able to make one work alone just fine. But when I make my graphics context (using UIGraphicsBeginImageContext()) large enough to encompass both, and set each UIView's frame so that they are side-by-side, the resulting image shows just the left-cell's content, squished horizontally.

Yes, but you need to set up the CTM to draw the layers in the right
place. To be clear, you're asking the views'  layers to
-renderInContext:, not the views themselves.

We use -renderInContext: to draw entire layer trees into one big
context. You obviously aren't doing the same thing, but the principle
is identical. You might want to look into our CALayer extension method
for doing so: https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniQuartz/CALayer-OQExtensions.m#L497

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: -renderInContext: with multiple layers?
      • From: Rick Mann <email@hidden>
References: 
 >-renderInContext: with multiple layers? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: How does Apple want us to deal with custom elements in Xcode 4, with IBPlugins having been killed?
  • Next by Date: Re: How does Apple want us to deal with custom elements in Xcode 4, with IBPlugins having been killed?
  • Previous by thread: -renderInContext: with multiple layers?
  • Next by thread: Re: -renderInContext: with multiple layers?
  • Index(es):
    • Date
    • Thread