Skip navigation.
 
mlRe: NSImage and NSImageView issues (not drawing correctly)
FROM : Michael Vannorsdel
DATE : Wed Apr 23 18:37:41 2008

You might need to specify a size for some formats for your 
imageToBeDrawn object.



On Apr 23, 2008, at 10:27 AM, Nick Rogers wrote:

> Hi,
> 1. I'm using:
> NSImage *image = [[NSImage alloc] initWithData:data];
> NSImageRep *imageRep = [image bestRepresentationForDevice:nil];
> NSImage *imageToBeDrawn = [[NSImage alloc] init];
> [imageToBeDrawn addRepresentation:imageRep];
> if ([imageToBeDrawn isValid] == YES)
>     [previewImage setImage:imageToBeDrawn];
> else
>     [previewImage setImage:nil];
> [data release];
>
> // where previewImage is of (NSImageView *) type.
>
> But certain images (even the small size like 100KB) are not 
> completely drawn, and the display shows garbled image.
> certain PNG image shows only a black rectangle. only some small 
> images are drawn in good quality.
>
> 2. Can I show text in NSImageView. Certain same category software 
> are showing text in the same place as their NSIMageView. So I was 
> wondering, how thats possible. (I have checked their nib files, and 
> the text show at the same place as thier NSImageView).

Related mailsAuthorDate
mlNSImage and NSImageView issues (not drawing correctly) Nick Rogers Apr 23, 18:27
mlRe: NSImage and NSImageView issues (not drawing correctly) Michael Vannorsdel Apr 23, 18:37