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

James Clancey james.clancey at gmail.com
Sun Jul 17 22:23:22 EDT 2011


Eric, 
If you do use Monomac.windows.forms contributions are welcome for parts that are not flushed out yet. As it stands system.drawing works in MonoMac. If you use monomac.forms I have already written code to allow you to convert an Image to NsImage. 

Thanks,
James Clancey

On Jul 17, 2011, at 6:16 PM, Duane Wandless <duane at wandless.net> wrote:

> 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
> 
> _______________________________________________
> 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/4c3f91d8/attachment.html 


More information about the Mono-osx mailing list