Re: NSImage ignoring interpolation: Is this a bug?
Re: NSImage ignoring interpolation: Is this a bug?
- Subject: Re: NSImage ignoring interpolation: Is this a bug?
- From: Scott Stevenson <email@hidden>
- Date: Sat, 25 Nov 2006 15:38:08 -0800
On Nov 25, 2006, at 1:16 PM, Mark Onyschuk wrote:
Just a thought, the -[NSImage compositeToPoint:operation:] is a
method from back in the NeXTstep days and has some behaviors that
are meant to be compatible with code from the days of Display
Postscript.
You might find that the -drawInRect:fromRect:operation:fraction:
method (that's new in Mac OS X and Quartz) behaves better for you.
One last post on this for the archives.
It turns out -drawInRect:fromRect:operation:fraction: makes things
drastically easier (at least in many cases) than compositeToPoint or
dissolveToPoint. There's no need to disable the cache, set scaling,
or even set the size! The drawInRect method does all the proper
smooth resizing itself.
In many cases, all you have to do this this:
[image drawInRect: destRect
fromRect: NSZeroRect
operation: NSCompositeSourceOver
fraction: 1.0];
What was I doing using compositeToPoint for so long?
Thanks, Mark.
- Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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