Re: Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);
Re: Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);
- Subject: Re: Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);
- From: David Duncan <email@hidden>
- Date: Sun, 14 Jun 2009 19:53:31 -0700
On Jun 12, 2009, at 11:53 AM, Frederick C. Lee wrote:
Is there a Cocoa/iPhone equivalent to Quartz's
CGImageCreateWithImageInRect(image, imageRect)?
The equivalent is... CGImageCreateWithImageInRect :). Keep in mind
that 9 times out of 10 what people want to use it for is not what that
API is really designed for. If you just want to draw part of an image,
use clipping & translation (either translate the CTM, or move your
drawing rect).
If you want to pan across an image (and it isn't too big) you can just
put the whole thing in a UIImageView contained in a UIScrollView. If
the image is fairly large, then you may want to use a CATiledLayer
(but you will have to draw it via Quartz instead of via UIImage's draw
methods).
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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