2

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.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Tom Irving
  • 10,041
  • 6
  • 47
  • 63

1 Answers1

3

Look into the NSShadow class. CGContextSetShadow also exists on the Mac, but it's slightly more difficult to get your hands on the context itself.

John Calsbeek
  • 35,947
  • 7
  • 94
  • 101