discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSImage


From: A. Arias
Subject: Re: NSImage
Date: Sun, 02 Sep 2012 16:47:51 -0600

Has you been added the image in GNUmakefile? Something like:

YourApp_RESOURCE_FILES = \
Resources/myImage.png


El dom, 02-09-2012 a las 21:07 +0000, Steve Van Voorst escribió:
>  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 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep





reply via email to

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