Re: Zooming images in NSView
Re: Zooming images in NSView
- Subject: Re: Zooming images in NSView
- From: Chris Giordano <email@hidden>
- Date: Sat, 11 Dec 2004 15:56:02 -0500
All,
On Dec 10, 2004, at 7:30 PM, John C. Randolph wrote:
On Dec 10, 2004, at 3:27 PM, Ricky Sharp wrote:
On Dec 10, 2004, at 1:36 PM, John C. Randolph wrote:
The simplest way is to shrink the bounds rect of the NSView by your
zoom factor.
And here's an example of how to do so:
http://dts.apple.com/qa/QA1346/qa1346.html
The link should be
<http://developer.apple.com/qa/qa2004/qa1346.html>, unless of course
you work for Apple :)
Whoops! That will teach me to drop a link into a mail message without
reading it..
-jcr
Thought I'd let everyone know of what looks like a bug in the
-scalePercent method in the sample code.
The original implementation returns a result that is roughly the
inverse of what one would expect. That is, one gets 50% instead of
200%, 25% instead of 400%, 200% instead of 50%, etc.
The fix is simple: divide 1 by the scale's width before multiplying by
100.
- (float) scalePercent
{
return (1.0 / [self scale].width) * 100.0;
}
Reported this morning: <rdar://3916447>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden