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

Duane Wandless duane at wandless.net
Sun Jul 17 22:16:15 EDT 2011


To provide the best Mac app I recommend rewriting the UI code.  Meaning you
should not be resigned to do that but excited and determined to provide the
best experience for your Mac users.

But you should also check out:
https://github.com/Clancey/MonoMac.Windows.Form

This is an interesting project that intends to use native Cocoa widgets for
WinForms apps.  I have not used it personally.

Also NSImage has FromStream:
https://github.com/mono/monomac/blob/master/src/AppKit/NSImage.cs

Best of luck,
Duane


On Sun, Jul 17, 2011 at 2:59 PM, Eric J. M. Smith <eric at tarkvara.org> wrote:

> Greetings,
>
> 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.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110717/eb56bc9f/attachment.html 


More information about the Mono-osx mailing list