Re: Fastest way to resize an image?
Re: Fastest way to resize an image?
- Subject: Re: Fastest way to resize an image?
- From: "Michael Ash" <email@hidden>
- Date: Sat, 22 Nov 2008 14:46:23 -0500
On Sat, Nov 22, 2008 at 1:36 PM, Jean-Nicolas Jolivet
<email@hidden> wrote:
> While we're on the subject, I was wondering... does NSBitmapImageRep has an
> equivalent to NSImage's
>
> drawInRect: fromRect: operation: fraction:
>
>
> Problem is... the ImageRep technique works well when I'm just scaling an
> image..it's quite fast too, however I am also cropping (in some cases)...
> and unfortunately, without the "fromRect" parameter, it's pretty much
> impossible to crop... right now I'm drawing my ImageRep in an intermediate
> NSImage so that i can use drawInRect: fromRect: when cropping but it takes
> tons of time (like 2-3x the time it takes by using just an ImageRep...)
> being able to use drawInRect: fromRect on an ImageRep would save me ton of
> time and headaches...
You can crop any drawing you wish by using the -[NSBezierPath addClip]
method. That NSImage allows you to do it inline is really just a
convenience.
Mike
_______________________________________________
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