Re: Problem with image size

Adam Fedor <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
On Nov 30, 2004, at 5:10 AM, Nicolas Sanchez wrote:

> Hello,
>
> My problem is very simple, but I have no simple solution.
>
> I load a big image, I resizes it but no memory is freed.
>
> I do this :
>
> NSImage *img = [[NSImage alloc] initWithContentsOfFile: 
> @"monImage.jpg"];
> [img setScalesWhenResized: YES];
> [img setSize: NSMakeSize(100, 100)];
>
> Here the memory is not freed, somebody has a solution ?
>

setSize sets the size of the cached image (the screen representation), 
not the size of the original image data. Even then, setting the size 
only invalidates the cache - it's possible that some of the memory for 
any system resources that have been used stays around after this 
happens.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.