How to properly display small, high resolution images?
How to properly display small, high resolution images?
- Subject: How to properly display small, high resolution images?
- From: that guy <email@hidden>
- Date: Sat, 15 Dec 2007 11:33:26 -0800 (PST)
Hey all - I'm trying to display a bunch of very small high resolution images, and I'm confused. They render perfectly well (full screen) in Preview or iPhoto, and yet when I do the standard
NSImage* tempImage = [[NSImage alloc] initWithContentsOfFile:filename];
NSSize newSize;
//snip - just sets the dimensions of newSize properly
NSImage *scaleImage = [[NSImage alloc] initWithSize:newSize];
[scaleImage lockFocus];
[[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
[tempImage drawInRect:NSMakeRect(0, 0, newSize.width, newSize.height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
[scaleImage unlockFocus];
[scaleImage drawInRect:NSMakeRect(screenSize.width/2-newSize.width/2, screenSize.height/2-newSize.height/2, newSize.width, newSize.height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
, everything ends up horrendously pixellated. The "actual" size of these images is tiny (like 150x150) and yet, as I said, they render in full screen perfectly well.
I also tried "NSImageInterpolationNone" on a lark - no luck. Can anyone give me a hint?
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
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