BSD
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists BSD

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old October 6th, 2005, 12:43 PM
Mike Morton
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #2  
Old October 6th, 2005, 04:12 PM
Ali Ozer
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #3  
Old October 7th, 2005, 12:36 PM
Mike Morton
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists BSD > can a Cocoa app scale jpeg images as nicely as Preview does?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek