开发者

Make an Image have rounded corners with Objective-C / pure C

How do you make an NSImage Image have rounded corners? I'm doing Mac Dev not iPhone de开发者_运维百科v.

Thanks in advance.


If you mean you want to draw a square image cropped to a rounded rectangle, take a look at NSBezierPath's clipping functions. Just clip to the frame you want and draw.


Make the corners of a regular rectangular NSImage transparent. You can do that by ANDing the alpha channel of the bitmap or image with an appropriate round-rect mask or mask image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜