Re: Properly scaling a vector image with CG
Re: Properly scaling a vector image with CG
- Subject: Re: Properly scaling a vector image with CG
- From: WT <email@hidden>
- Date: Mon, 25 May 2009 02:15:58 +0200
Hi Gwynne,
I'm not sure if this will help, but UIView instances have a
'contentMode' property which you can set to UIViewContentModeRedraw,
which forces the instance to redraw itself (by auto-calling -
setNeedsDisplay) when the view's'bounds' property changes. You can
also set it through IB.
Wagner
On May 25, 2009, at 12:48 AM, Gwynne Raskind wrote:
I have a UIView inside a UIScrollView. The UIView has a bunch of
CALayers with custom drawing code which render vector images. A nice
thing about vector images is that when you zoom in on them, they
still look good. But using UIScrollView's zooming support, I still
get nasty bitmap zooming - because UIScrollView is setting the
transform property of my view, which is transforming the contents of
the view without redrawing them. How can I manipulate the scaling so
that my drawing code can scale the drawing properly? I'm okay with
it looking blocky during the zoom animation, as long as it redraws
prettily when the zoom is done.
The only solution I can see right now is to track the user's zoom
gesture by hand and manipulate my view's bounds, scroll view's
content size, and layer scaling values by hand. This seems like a
very ugly solution which duplicates a lot of effort that
UIScrollView puts in for me.
Any thoughts? Any help is appreciated.
-- Gwynne, Daughter of the Code
"This whole world is an asylum for the incurable."
_______________________________________________
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