[Mono-osx] System.Drawing into Cocoa views?

Eric J. M. Smith eric at tarkvara.org
Sun Jul 17 17:59:51 EDT 2011


I'm new to MonoMac (and to Mono in general).  So I apologise in advance for my ignorance.

I'm exploring the feasibility of porting a .NET/Windows app to run on the Mac.  I've resigned myself to the fact that we'll be rewriting any code which relies on Windows.Forms widgets.  Our existing rendering code draws into a System.Drawing.Image, and it would be nice to not have to rewrite everything.  Is there any way of drawing into a System.Drawing.Graphics and making the results available to Cocoa?  Either by drawing directly into an NSView or by somehow getting the contents of a System.Drawing.Image into an NSImage.

I did find some mention on this mailing-list of a "drawing bridge" to do libgdiplus drawing in a Cocoa custom view, but I can't find any documentation or samples for this (plus, it sounds like this approach might require X11).

Thanks for your help,

Eric Smith
Tarkvara Design Inc.

More information about the Mono-osx mailing list