discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage


From: Steve Van Voorst
Subject: NSImage
Date: Sun, 2 Sep 2012 21:07:51 +0000 (GMT)

 I am unable to get the following code to place an image in an NSImageView.  OS = Ubuntu 12.04.

NSImageView *imageView = [[NSImageView alloc] initWithFrame:NSMakeRect( 30, 130, 100, 100 )];
 [[window contentView] addSubview:imageView];
 NSImage *image = [NSImage imageNamed:@"myImage.png"];
 [imageView setImageScaling:NSScaleToFit];
 [imageView setImage:image]; 
 [imageView release];

I have placed the image in the same folder as the source code.  Specifically, I am unable to generate the image object; it returns null.

I unsuccessfully tried -initWithContentsOfFile:, placing the image in the Resources folder, and using a .jpg instead of a .png.  Still no image.  I would appreciate any help.  Thanks.

Steve Van Voorst
reply via email to

[Prev in Thread] Current Thread [Next in Thread]