Take a rounded image with Objective-C / pure C

How do you create an NSImage image with rounded corners? I am making a Mac Dev, not an iPhone.

Thanks in advance.

+3
source share
2 answers

If you want to draw a square image cropped to a rounded rectangle, take a look at the NSBezierPath clipping functions. Just click on the frame you want and draw.

+5
source

Make the corners of a regular rectangular NSImage transparent. You can do this by using ANDing the alpha channel of a bitmap or an image with a suitable mask or an image mask with a rounded line.

0
source

Source: https://habr.com/ru/post/1762336/


All Articles