Re: How to draw background image in my app window
Re: How to draw background image in my app window
- Subject: Re: How to draw background image in my app window
- From: Michael Vannorsdel <email@hidden>
- Date: Sat, 30 May 2009 13:12:53 -0600
You'd really be better off making an NSView subclass and having it
draw the image you want in drawRect:.
- (void)awakeFromNib
{
myImage = [[NSImage alloc] init....
[self setNeedsDisplay:YES];
}
- (void)drawRect:(NSRect)rect
{
NSSize isize = [myImage size];
[myImage drawInRect:[self bounds] fromRect:NSMakeRect(0.0, 0.0,
isize.width, isize.height) operation: NSCompositeCopy fraction:1.0];
}
*this was written in mail, may gave errors.
On May 30, 2009, at 11:45 AM, cocoa learner wrote:
Yah Andy and Michael you all were right. But still I have some
problem.
1>. While resizing the window Image is not getting resized.
2>. My controls (NSButton and NSTextField) are not visible after the
awakeFromNib call.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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