NPAPI:CoreGraphicsDrawing: Difference between revisions

Jump to navigation Jump to search
Line 75: Line 75:
== Bridging QuickDraw and CoreGraphics ==
== Bridging QuickDraw and CoreGraphics ==


You might be asking yourself, "Great...  So now I can make a plugin that draws using CoreGraphics, but it will only run in browsers that support this NPAPI extension?"
There is a way for plugins to draw using CoreGraphics, yet remain compatible with QuickDraw-only browsers.  The idea is to use QDBeginCGContext() and QDEndCGContext() to obtain a CGContextRef for the CGrafPtr provided by the browser.
 
Don't worry!  There is a way for plugins to draw using CoreGraphics, yet remain compatible with QuickDraw-only browsers.  The idea is to use QDBeginCGContext() and QDEndCGContext() to obtain a CGContextRef for the CGrafPtr provided by the browser. We will be shipping some sample code to demonstrate this technique, but here is a little snippet for your enjoyment:


  static CGContextRef beginQDPluginUpdate(NPWindow *window)
  static CGContextRef beginQDPluginUpdate(NPWindow *window)
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu