Scenario:
I am editing some CGImage and, oddly enough, so far I have first created NSImage from these CGImage before drawing them. So I tried changing the code to draw a CGImage directly in NSGraphicsContext.currentContext().graphicsPort . As you can see, I use Swing here, but the same problem occurs for Objective-C, I suppose.
Looking at the documentation, I saw that graphicsPort would be deprecated at 10.10, but I could not find another way for the current CGContext from NSGraphicsContext and there is no way to create a CGContext from NSGraphicsContext .
Question:
Does anyone know what would be the right way to get context? If not - is there a way to make graphicsPort COpaquePointer , which is apparently an initialized NSPipe object, a CGContextRef ? Although using code that is already marked as deprecated will be quite unsatisfactory, I would consider it until there is a better solution.
source share