[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to draw image in menu title?

From: Adam Fedor
Subject: Re: Best way to draw image in menu title?
Date: 03 Sep 2003 22:16:01 -0600

On Mon, 2003-09-01 at 21:36, Jason Clouse wrote:
> I'm plinking around with a theme bundle to match my WindowMaker theme.  I'm 
> trying to draw an image into the menu titlebar (NSMenuWindowTitleView, 
> drawRect method).  What's currently there is this:
>    [[NSColor windowFrameColor] set];
>    NSRectFill(workRect);
> There is an NSDrawBitmap() function, but the Apple docs say it might be more 
> useful to employ the NSBitmapImageRep class; though there are plenty of other 
> bitmap and image classes too.  The question: which class do you guys think 
> would be best for this task, both for functionality and performance 
> considerations?  I'm pretty new to the GUI classes, so I may need some 
> in-depth guidance on this.

NSBitmapImageRep is basically a wrapper around NSDrawBitmap, so it's
probably better to use the class. You would use this class if you wanted
to save/load (mostly custom) images to/from the disk. 

Most likely if you just want to read an image from the disk and display
it in a view, you use NSImage (which encapuslates NSBitmapImageRep and
other representations). See

-[NSImage compositeToPoint:operation:]

to do this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]