[Top][All Lists]

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

Re: Problem loading a picture.

From: Nicolas SANCHEZ
Subject: Re: Problem loading a picture.
Date: Fri, 12 Mar 2004 18:26:55 +0100
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

Fred Kiefer wrote:
Nicolas SANCHEZ wrote:
I've a picture in my app directory (included in GNUmakefile), when I exec my prog in the src dir, the picture is loaded, but after doing a make install and executing the prog anywhere the picture is not loaded.

Is it necessary to tell the complete path when loading the picture ?

Could you just provide the GNUmakefile and the line of code where you load the picture? The solution is probably as easy as to put the picture  into the XXX_RESOURCE_FILES in the GNUmakefile, but how could I tell, if you aren't doing this already?


in the GNUmakefile:

CameraTransfer_RESOURCE_FILES= \
CameraTransferInfo.plist \
CameraTransfer.tiff \

in the source code:

NSImage *img = [[NSImage alloc] initWithContentsOfFile: @"CameraTransfer_header.tiff"]];

but somebody helps me to find this (which works):

NSImage *img = [[NSImage alloc] initWithContentsOfFile: [[NSBundle mainBundle] pathForImageResource: @"CameraTransfer_header.tiff"]];

But I think that the first code should works also, shouldn't it ?

reply via email to

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