background image in cocoa view AU
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