Draw shadow under NSImage

Posted by Tom Irving on Stack Overflow See other posts from Stack Overflow or by Tom Irving
Published on 2010-04-20T21:48:39Z Indexed on 2010/04/20 21:53 UTC
Read the original article Hit count: 398

Filed under:
|
|
|
|

Currently I'm drawing an NSImage in a custom NSCell like so:

- (void)drawInteriorWithFrame:(NSRect)theCellFrame inView:(NSView *)theControlView {
    // roundedCornerImage creates a new NSImage with rounded corners, rather than clipping.
    [[anIcon roundedCornerImage:5] drawInRect:anIconBox fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
}

Very simply I'm wondering how to draw an image underneath it. On the iPhone, I would do this by using: CGContextSetShadow (currentContext, CGSizeMake(1, -1), 2); just before drawing the UIImage, but I'm unfamiliar with how to do it on the Mac.

Any pointers would be great.

© Stack Overflow or respective owner

Related posts about nscell

Related posts about nsimage