2

現在、次のようにカスタム NSCell で NSImage を描画しています。

- (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];
}

非常に単純に、その下に画像を描く方法を考えています。iPhone では、次を使用してこれを行いますCGContextSetShadow (currentContext, CGSizeMake(1, -1), 2)。UIImageを描画する直前ですが、Macでそれを行う方法に慣れていません。

どんな指針も素晴らしいでしょう。

4

1 に答える 1

3

NSShadowクラスを調べます。CGContextSetShadowMacにも存在しますが、コンテキスト自体を手に入れるのは少し難しいです.

于 2010-04-20T21:52:24.803 に答える