• 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
background image in cocoa view AU
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

background image in cocoa view AU


  • Subject: background image in cocoa view AU
  • From: Nicolas Dangy-Caye <email@hidden>
  • Date: Wed, 19 Jan 2005 10:25:09 +0100

Hi,

I'm trying to "convert" a VST plugin I wrote into an Audio Unit.
I'm new to Audio Unit (and also Obj-C and Cocoa !!!), so please be indulgent with my dummy questions...

I use the AudioUnit with CocoaView template and I want to add a background image into the view.
I added a background.png into the NIB file thanks to IB and add this code :

@interface
CocoaView : NSView
{
...
NSColor * mBackgroundColor;
...
}

- (void)awakeFromNib {
NSImage *background = [NSImage imageNamed:@"background"];
mBackgroundColor = [NSColor colorWithPatternImage:background];
[mBackgroundColor retain];
}

- (void)drawRect:(NSRect)rect {
[mBackgroundColor set];
[NSBezierPath fillRect:rect];
}

The result is a black background...
The problem seems to come from the NSImage background initialisation, the pointer stays nil after the [NSImage imageNamed:@"background"] message.
What's wrong with my code ?

thank for your help,
Nicolas.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • OT: Re: background image in cocoa view AU
      • From: Pavol Markovic <email@hidden>
  • Prev by Date: Re: Using converter API for a multiple streams driver
  • Next by Date: Re: OS X USB/Midi Driver bugs?
  • Previous by thread: USb audio driver (camcorder)
  • Next by thread: OT: Re: background image in cocoa view AU
  • Index(es):
    • Date
    • Thread