Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Zooming/Scaling an NSView subclass?

Zooming/Scaling an NSView subclass?
Thread Tools
Junior Member
Join Date: Jun 2002
Location: Springfield
Status: Offline
Reply With Quote
Oct 12, 2003, 11:20 PM
 
Does anyone know if it's possible to zoom or scale a subclass of NSView and how I would go about coding such a thing?

For example, what if I wanted to show a web page rendered in a WebView at 50% it's actual size? Or 200%?

Basically, I'd like to do something along the lines of Preview.app's Thumbnails drawer in my app.

Thanks in advance.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 13, 2003, 12:55 AM
 
I'd imagine Preview's thumbnail drawer is done by applying an NSAffineTransform and then compositing the page images. I haven't really looked at WebKit, though, so I couldn't tell you the best way to go thumbnailing its content. Basically, though, there are two ways of scaling things in Cocoa: Using NSAffineTransform directly, or changing an NSView's coordinate system (i.e. with setBoundsSize:). And generally, NSAffineTransform is what you're looking for.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2