• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
imageNamed cannot load an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

imageNamed cannot load an image


  • Subject: imageNamed cannot load an image
  • From: Artemiy Pavlov <email@hidden>
  • Date: Wed, 21 Mar 2007 20:07:56 +0200

Hello!

I have an image file SpaceOscillator.png which resides in my "Resources" and in the Interface Builder as SpaceOscillator. When I try to draw it, it just doesn't work: the code I use is below, and I always get "Couldn't load background image".

Can anyone suggest what I should do?


Thanks very much,

Artemiy.


NSImage *BackgroundImage = [NSImage imageNamed:@"SpaceOscillator"]; if(BackgroundImage == nil){ printf("Couldn't load background image\n"); } else { printf("Loaded background image\n"); } [BackgroundImage drawAtPoint:NSMakePoint(0.0, 0.0) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; _______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: imageNamed cannot load an image
      • From: Kevin Hoctor <email@hidden>
  • Prev by Date: Re: NSImage lockFocus throws exception?
  • Next by Date: Glyph from Character
  • Previous by thread: Re: Problem with NSImageCell and -setImageScaling
  • Next by thread: Re: imageNamed cannot load an image
  • Index(es):
    • Date
    • Thread