Re: Adding an image to a project

2010-07-16 Thread Vincenzo Morgante
I used [NSBundle bundleForClass:[self class]]... And now the plugin works without any problems!!! Thanks! Vincenzo --- Ven 16/7/10, B.J. Buchalter ha scritto: Da: B.J. Buchalter Oggetto: Re: Adding an image to a project A: "Vincenzo Morgante" Cc: "Cocoa Development" Dat

Re: Adding an image to a project

2010-07-15 Thread B.J. Buchalter
On Jul 15, 2010, at 6:17 PM, Vincenzo Morgante wrote: > Since > the plugin still does not work on my system, I'll try to create a new > project following again the wizard for the development of > plug-in for OsiriX. After > all, it works on another system... If you are creating a plugin (rat

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
o: Re: Adding an image to a project A: "Vincenzo Morgante" Cc: "Wim Lewis" , cocoa-dev@lists.apple.com Data: Giovedì 15 luglio 2010, 12:48 On 15/07/2010, at 7:25 PM, Vincenzo Morgante wrote: > The subfolder "Resources" does not exist... The Resources folder exists

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
I added the image via XCode's interface: right button on Resources folder, add external file... Now it works without any problems, but not on my system: we created a new project in another system and we added the same source file and the image, then we built the project and it worked... Maybe th

Re: Adding an image to a project

2010-07-15 Thread Ron Fleckner
On 15/07/2010, at 7:25 PM, Vincenzo Morgante wrote: > The subfolder "Resources" does not exist... The Resources folder exists inside your built executable's package. You don't add files to that after the build using the Finder. I suspect you have dragged your image into your projects folder i

Re: Adding an image to a project

2010-07-15 Thread Andy Lee
On Jul 15, 2010, at 5:25 AM, Vincenzo Morgante wrote: >> If you put the image into your project and add it to your application >> target, Xcode will> automatically add it to a "Copy Files" build phase that >> places the image into> WhateverApp.app/Contents/Resources/imagename.png. >> That is a

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
> If you put the image into your project and add it to your application target, >Xcode will> automatically add it to a "Copy Files" build phase that places the >image into> WhateverApp.app/Contents/Resources/imagename.png. That is also the >place that -> pathForResource:ofType: will look for it.

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
> One last amateurish wild guess: does Xcode list the image along with all your > source files> and other files which are part of your project in the pane > above the editor when you select> the Target or Project icon in the Groups & > Files list?Yes, it appears, but its role is empty... > Does

Re: Adding an image to a project

2010-07-15 Thread Ron Fleckner
> > Vincenzo > > --- Gio 15/7/10, Ron Fleckner ha scritto: > > Da: Ron Fleckner > Oggetto: Re: Adding an image to a project > A: "Vincenzo Morgante" > Cc: cocoa-dev@lists.apple.com > Data: Giovedì 15 luglio 2010, 09:42 > > > On 15/07/2010, at

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
kner Oggetto: Re: Adding an image to a project A: "Vincenzo Morgante" Cc: cocoa-dev@lists.apple.com Data: Giovedì 15 luglio 2010, 09:42 On 15/07/2010, at 5:18 PM, Vincenzo Morgante wrote: > The path for resource is not displayed because the object 'imageName' i

Re: Adding an image to a project

2010-07-15 Thread Ron Fleckner
On 15/07/2010, at 5:18 PM, Vincenzo Morgante wrote: > 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: Hello Vincenzo, just a wild guess from an amateur: Did you just p

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
Thanks a lot! Vincenzo --- Gio 15/7/10, Graham Cox ha scritto: Da: Graham Cox Oggetto: Re: Adding an image to a project A: "Vincenzo Morgante" 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 wrot

Re: Adding an image to a project

2010-07-15 Thread Vincenzo Morgante
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 --- Mer 14/7/10, Wim Lewis ha scritto: Da: Wim Lewis Oggetto: Re: Adding an image to a project A:

Re: Adding an image to a project

2010-07-14 Thread Kirk Kerekes
Google for "OpenCV Cocoa" -- there is at least one Google Code hosted project, and many other hits. I'll bet someone has solve this and many other similar problems already. Don't struggle, Google. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

Re: Adding an image to a project

2010-07-14 Thread Graham Cox
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 yo

Re: Adding an image to a project

2010-07-14 Thread Wim Lewis
On Jul 14, 2010, at 10:01 AM, Vincenzo Morgante wrote: > I wrote the following code, but it does not work: the program crashes... > NSString* imageName = [[NSBundle mainBundle] pathForResource:@"image1" > ofType:@"png"]; > IplImage *image = cvLoadImage([imageName UTF8String], ...); That should w

Re: Adding an image to a project

2010-07-14 Thread David Duncan
On Jul 14, 2010, at 10:01 AM, Vincenzo Morgante wrote: > I wrote the following code, but it does not work: the program crashes... > NSString* imageName = [[NSBundle mainBundle] pathForResource:@"image1" > ofType:@"png"]; > IplImage *image = cvLoadImage([imageName UTF8String], ...); Where does it

Re: Adding an image to a project

2010-07-14 Thread Vincenzo Morgante
I wrote the following code, but it does not work: the program crashes... NSString* imageName = [[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png"]; IplImage *image = cvLoadImage([imageName UTF8String], ...); Maybe the only solution is a copy pixel by pixel... If the source image is RG

Re: Adding an image to a project

2010-07-14 Thread Andy Lee
On Jul 14, 2010, at 7:55 AM, Vincenzo Morgante wrote: > Well,I read the documentation at > link > and the example [NSImage imageNamed:]... > However in this way I ge

Re: Adding an image to a project

2010-07-14 Thread Graham Cox
On 14/07/2010, at 9:55 PM, Vincenzo Morgante wrote: > Well,I read the documentation at > link > and the example [NSImage imageNamed:]... > However in this way I ge

Re: Adding an image to a project

2010-07-14 Thread Vincenzo Morgante
Well,I read the documentation at link and the example [NSImage imageNamed:]... However in this way I get a NSImage, but I need of an IplImage object...So I should c

Re: Adding an image to a project

2010-07-14 Thread Sam
Check out XCode's 'Build Phases' that your images are included in 'Copy Bundle Resources' so that when you do a build your image resources are properly copied inside your bundle. Then check out this URL on loading image resources.

Re: Adding an image to a project

2010-07-14 Thread Graham Cox
On 14/07/2010, at 9:12 PM, Vincenzo Morgante wrote: > How could I resolve the problem? Put it in your resources and load it with [NSImage imageNamed:] This is all well-documented. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P