Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Cairo in a Cocoa app

I know Cairo has support for Quartz output, but how would one implement such a thing in a Cocoa app? I haven't really found any good examples of this being done in the documentation.

like image 568
Q2Ftb3k Avatar asked Mar 07 '26 19:03

Q2Ftb3k


1 Answers

You can obtain a CGContextRef from an NSView by calling [[[myView window] graphicsContext] graphicsPort]. You can then create a Cairo context from the CGContextRef.

like image 123
user1118321 Avatar answered Mar 09 '26 14:03

user1118321



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!