Cocoa 在NSImage下绘制阴影
目前,我正在自定义NSCell中绘制NSImage,如下所示:Cocoa 在NSImage下绘制阴影,cocoa,shadow,nsimage,nscell,Cocoa,Shadow,Nsimage,Nscell,目前,我正在自定义NSCell中绘制NSImage,如下所示: - (void)drawInteriorWithFrame:(NSRect)theCellFrame inView:(NSView *)theControlView { // roundedCornerImage creates a new NSImage with rounded corners, rather than clipping. [[anIcon roundedCornerImage:5] drawIn
- (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上进行
任何指点都会很好。看看这门课CGContextSetShadow
也存在于Mac上,但要掌握上下文本身就稍微困难一些