Re: NSImage from Web: Resolution
Re: NSImage from Web: Resolution
- Subject: Re: NSImage from Web: Resolution
- From: Matt Judy <email@hidden>
- Date: Sun, 16 Dec 2001 02:09:32 -0800
Solved my own problem.
Instead of setting up an NSImage with initWithData, I set up an
NSBitmapImageRep with initWithData, and then setup the NSImage using
that imageRep.
NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc]
initWith
Data:[someNSURL resourceDataUsingCache:YES]];
NSImage *theImage = [[NSImage alloc] initWithSize:[comicImageBitmapRep
size]];
[comicImage addRepresentation:comicImageBitmapRep];
[comicImage setScalesWhenResized:YES];
[comicImage setSize:NSMakeSize([comicImageBitmapRep pixelsWide],
[comicImageBitmapRep pixelsHigh])];