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

OT: Re: background image in cocoa view AU


  • Subject: OT: Re: background image in cocoa view AU
  • From: Pavol Markovic <email@hidden>
  • Date: Wed, 19 Jan 2005 12:06:47 +0100

Nicolas,

I think this should have been posted to Cocoa mailing list.

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 ?

Probably your the image is missing in plugin bundle's Resources folder.

I recommend placing image directly into Nib view - using NSImageView object. Just place this object with no border, send it back in layout hierarchy and assign image name to it.

Best,
Pavol Markovic


On 19.1.2005, at 10:25, Nicolas Dangy-Caye wrote:

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


This email sent to email@hidden

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >background image in cocoa view AU (From: Nicolas Dangy-Caye <email@hidden>)

  • Prev by Date: Re: OS X USB/Midi Driver bugs?
  • Next by Date: Fwd: background image in cocoa view AU
  • Previous by thread: background image in cocoa view AU
  • Next by thread: Fwd: background image in cocoa view AU
  • Index(es):
    • Date
    • Thread