Re: Snapshotting hidden UIViews
Re: Snapshotting hidden UIViews
- Subject: Re: Snapshotting hidden UIViews
- From: Matt Neuburg <email@hidden>
- Date: Wed, 13 Jan 2010 09:24:55 -0800
- Thread-topic: Snapshotting hidden UIViews
On Tue, 12 Jan 2010 14:18:05 -0600, Michael Gardner <email@hidden>
said:
>I'm trying to create a "snapshot" UIImage from a UITextView that's inside a
larger, hidden UIView. renderInContext: works fine for visible UIView layers,
but I can't get consistent results for hidden views.
>
>I read somewhere (can't recall the source, but it wasn't authoritative) that
this is expected behavior, and that -renderInContext: is only guaranteed to work
for visible UIViews' layers. Is this true? If so, how else can I replicate
*exactly* what my UITextView would look like when visible?
In my JACTVocab app I have a similar problem: I need to make a "snapshot" of
a situation in my window that doesn't exist yet. In other words, my window
is in situation A, but I need a snapshot of situation B. I will eventually
show the user situation B, but I need the snapshot first.
So what I do is: I take a snapshot of situation A, and cover the window with
a borderless window containing that snapshot. This hides what I am about to
do in the real window. Now I change the situation in the window to situation
B. The user cannot see this happening because snapshot of situation A is
covering the window. Now I take the snapshot of situation B (this works
perfectly well even though the second window is covering it).
The hand is quicker than the eye, and the user never notices (I hope).
Also, I use cacheDisplayInRect, not renderInContext. But it may be that
there are reasons why you don't have that option...
Hope this helps some - m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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