You're right, but unfortunately the project deadline is near: after all, the 
goal of this university project on computer vision is another and therefore we 
prefer to concentrate on the real goal of the project.The image that we can not 
load should be used to display a simple report containing the results, so 
reluctantly I'd be happy even pixel by pixel copy from a NSImage object to an 
object IplImage.However, perhaps I understand the problem...
NSString* imageName = [[NSBundle mainBundle] pathForResource:@"report" 
ofType:@"png"];if(imageName) {    // print the path for resource}
The path for resource is not displayed because the object 'imageName' is 
nil.Why this object is nil?I added the file "report.png" to the folder 
Resources of my project: I will check whether the image is actually into 
WhateverApp.app/Contents/Resources/
Thanks a lot!
Vincenzo
--- Gio 15/7/10, Graham Cox <graham....@bigpond.com> ha scritto:

Da: Graham Cox <graham....@bigpond.com>
Oggetto: Re: Adding an image to a project
A: "Vincenzo Morgante" <enzo...@yahoo.it>
Cc: cocoa-dev@lists.apple.com
Data: Giovedì 15 luglio 2010, 01:49


On 15/07/2010, at 3:01 AM, Vincenzo Morgante wrote:

> I wrote the following code, but it does not work: the program crashes...

> Maybe the only solution is a copy pixel by pixel...


Code never crashes for no reason. And you have tools which will explain the 
reason, in excruciating detail if you want it, so find the problem and fix it. 
Why give up at the first whiff of trouble when the approach you're taking is 
basically right, and assume the solution must obtain by a ridiculously more 
complex and slow method?

--Graham

 



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to