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

Eric J. M. Smith eric at tarkvara.org
Mon Jul 18 12:22:44 EDT 2011


On 18/07/2011, Alain Bocherens <alain at slide-effect.com> wrote:
> I faced the exact same problem. I wrote a small class to handle this
> case. It is derived from NSView and you only have to inherit from it and
> wrote your own OnPaint method.

Hi Alain,

Thanks for the code.  My only concern is about the performance hit
from copying into an array and converting to and from PNG format.  It
should be possible to get the pixel data directly from your
System.Drawing.Image (using lockBits), use that to initialise an
NSBitmapRep, and create the NSImage from that.

But from everybody's responses, the impression I get is that MonoMac
doesn't have any built-in support for getting System.Drawing content
into a Cocoa view, so we have to come up with our own workarounds.
Nobody knows anything about the "drawing bridge" mentioned in
http://lists.ximian.com/pipermail/mono-osx/2011-February/004094.html?

Thanks,

Eric Smith
Tarkvara Design Inc.


More information about the Mono-osx mailing list