Re: Resizing an image

2008-12-12 Thread Glenn Bloom
So it looks like I now have a better solution for copying an image file and reducing its size both in dimensions and in bytes, thanks to a couple of recommendations I received. Of course, other recommendations made clear that I need to learn more about alternative approaches: - some experimentatio

Re: Resizing an image

2008-12-11 Thread Ian was here
Here's a simple method for resizing. I made it a category of NSImage. - (NSImage *)resizedImageForSize:(NSSize)size { NSImage*resizedImage = [[[NSImage alloc] initWithSize:size] autorelease]; [resizedImage lockFocus]; [self drawInRect:[resizedImage bounds] fromRect:[self bounds] opera

Re: Resizing an image

2008-12-11 Thread Glenn Bloom
Steve, thank you - I just tested your recommendation - it appears to work well. Doug, I just got your recommendation and will look into CICrop and CILanczosScaleTransform, and CGImageRef documentation on creating images of a particular size. I'm in fact about to run out to a Cocoaheads meeting, s

Re: Resizing an image

2008-12-11 Thread douglas welton
Hi Glenn, Your answers a little bit non-specific, so at best I will have to give you a non-specific response. Two suggestions: 1) Core Image is your friend! In your case, CICrop and CILanczosScaleTransform may be of some help. 2) CGImageRef is your other friend! In particular, see th

Re: Resizing an image

2008-12-11 Thread Steve Christensen
On Dec 11, 2008, at 5:43 AM, Glenn Bloom wrote: Can anyone recommend a best practice for resizing an image to reduce its size in terms of both bytes and visible dimensions, retaining the new smaller image and eliminating the original from memory? In how I go about this now, I am concerned