Completely resizing NSImage
Completely resizing NSImage
- Subject: Completely resizing NSImage
- From: Michael Becker <email@hidden>
- Date: Fri, 26 Mar 2004 09:41:15 +0100
Hi!
My application has to deal with a lot of image thumbnail which it
generates. I didn't really think much about it, but recently I've read
on this list, that -setSize: doesn't "truly" resize the image, only a
representation of it (as far as i remember).
I've checked my application's memory usage using the unix "top"
command, only to realise in shock that when holding about 40 thumbnails
it uses more than 100 MB of memory.
I've replaced the -setSize: call with creating another NSImage through
"initWithSize:" and then drawing the old image into the new one and
releasing the old one. Now my application will use only about 10 MB
when holding about 80 images. So that's a good thing :-)
My question: Are there any other "traps" when dealing with NSImage? Are
there any switches or the like for turning off any additional
complexity?
Bye,
Michael
_______________________________________________
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.