|
|
|
|
|||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
can a Cocoa app scale jpeg images as nicely as Preview does?
Folks --
When I load a jpeg image into my app and shrink it, certain images look pretty awful. When I open the same image in Preview and Zoom a bunch of times, it briefly looks awful, but then it sharpens up and looks great. For example, try grabbing <and doing Zoom six times, scaling it down 8x in each dimension. You can almost read the text. When I scale that image by the same amount in a simple Cocoa app (by resizing the NSImage or by making the NSImageView the right size), it comes out pretty ugly I’m sure there are techniques and libraries out there to do this, but I thought NSImage would do a good job right out of the box Thanks, -- Mike Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com) Help/Unsubscribe/Update your Subscription: %40developershed.com This email sent to bsdarchive (AT) developershed (DOT) com |
|
#2
|
|||
|
|||
|
can a Cocoa app scale jpeg images as nicely as Preview does?
You can get better scaling via -[NSGraphicsContext
]. Ali Begin forwarded message: From: Mike Morton <mike.morton (AT) sonos (DOT) com> Date: 6, 2005 9:34:33 AM PDT To: Cocoa-Dev <cocoa-dev (AT) lists (DOT) apple.com> Subject: can a Cocoa app scale jpeg images as nicely as Preview does? > Folks -- > When I load a jpeg image into my app and shrink it, certain images look pretty awful. When I open the same image in Preview and Zoom a bunch of times, it briefly looks awful, but then it sharpens up and looks great. > For example, try grabbing < B000006TRV.01._SCLZZZZZZZ_.jpgand doing Zoom six times, scaling it down 8x in each dimension. You can almost read the text. > When I scale that image by the same amount in a simple Cocoa app (by resizing the NSImage or by making the NSImageView the right size), it comes out pretty ugly > > I’m sure there are techniques and libraries out there to do this, but I thought NSImage would do a good job right out of the box > Thanks, > -- Mike Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com) Help/Unsubscribe/Update your Subscription: %40developershed.com This email sent to bsdarchive (AT) developershed (DOT) com |
|
#3
|
|||
|
|||
|
can a Cocoa app scale jpeg images as nicely as Preview does?
Ali et alia --
This worked great. Googling for setImageInterpolation:, I found <>. the techniques there, I found that I had to use drawInRect: -- compositing didn’t work for me. I wound up doing: NSImage *result = [[[NSImage alloc] initWithSize: newSize] autorelease]; [result lockFocus]; [[NSGraphicsContext currentContext] setImageInterpolation: quality]; [self drawInRect: NSMakeRect (0, 0, newSize.width, newSize.height) fromRect: NSMakeRect (0, 0, currentSize.width, currentSize.height) operation: NSCompositeCopy fraction: 1.0]; [result unlockFocus]; Thanks! -- Mike 6, 2005, at 4:02 PM, Ali wrote: You can get better scaling via -[NSGraphicsContext ]. Ali > > > Begin forwarded message: > >From: Mike Morton <mike.morton (AT) sonos (DOT) com> >Date: 6, 2005 9:34:33 AM PDT >To: Cocoa-Dev <cocoa-dev (AT) lists (DOT) apple.com> >Subject: can a Cocoa app scale jpeg images as nicely as Preview does? >> >Folks -- >> >When I load a jpeg image into my app and shrink it, certain images >look pretty awful. When I open the same image in Preview and Zoom >a bunch of times, it briefly looks awful, but then it sharpens up and >looks great. >> >For example, try grabbing >< >and doing Zoom six times, scaling it down 8x in each dimension. >You can almost read the text. >> >When I scale that image by the same amount in a simple Cocoa app (by >resizing the NSImage or by making the NSImageView the right size), it >comes out pretty ugly >> >> >I’m sure there are techniques and libraries out there to do this, but >I thought NSImage would do a good job right out of the box >> >Thanks, >> >-- Mike > Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com) Help/Unsubscribe/Update your Subscription: %40developershed.com This email sent to bsdarchive (AT) developershed (DOT) com |
![]() |
| Viewing: Web Development Archives > Mailing Lists > BSD > can a Cocoa app scale jpeg images as nicely as Preview does? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|