Re: better image scaling?
Re: better image scaling?
- Subject: Re: better image scaling?
- From: Paul Collins <email@hidden>
- Date: Tue, 18 May 2004 09:16:46 -0700
Matt,
To scale and render images, I use NSImage rather than NSImageRep
directly. Not certain this is the best way, but so far so good:
NSImage *image = [NSImage imageNamed:@"foo"];
NSRect imageRect = NSMakeRect(0,0,0,0);
[image setScalesWhenResized:YES];
[image setSize: <the size you want to draw>];
imageRect.size = [image size];
[image drawAtPoint:<some point in your view> fromRect:imageRect
operation:NSCompositeSourceOver fraction:1.0];
You may prefer -drawInRect to -drawAtPoint. Scott Anguish's Cocoa book
has a good NSImage discussion (although the scaling technique may not
be from there). Perhaps Scott has an even better idea. :-)
Paul Collins
On May 17, 2004, at 11:21 AM, matt neuburg wrote:
>
In my app I scale images to make thumbnails using NSImageRep
>
drawInRect:.
>
When these thumbnails are reasonably large it is easy to see that the
>
results are fuzzy
** Now in Public beta!
http://www.opendoor.com/envision/ **
** Envision: a new way to experience the web **
** Gracion Software
http://www.gracion.com/ **
** Tel: +1 (541) 488-3488 iChat/AV/AIM: gracionsoft **
** DigiTunnel 1.3 PPTP/VPN client for OS X **
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.