[Mono-osx] System.Drawing on Cocoa?

JoeStrout joe at strout.net
Mon Mar 25 21:35:15 UTC 2013


I'm a complete newbie to Mono and MonoMac.  I see that data types from
System.Drawing are used throughout (for example, in the parameter to
NSView.DrawRect), but all the examples I've found do their actual drawing
using wrapped Cocoa methods (NSBezierPath for example).  In addition, poking
around in the System.Drawing factory methods, I don't see any which seem to
apply to the Mac (and there is no public constructor).

So, while System.Drawing has all sorts of nifty and portable-looking drawing
methods, it looks to me like you can't use it in a Cocoa app.  Is that
correct?

What I'm really trying to accomplish is to isolate all my drawing code from
the underlying details, so that if I decide to port my app to Windows or
Linux or Android or whatever, I won't have to rewrite it all.  So I started
on a bridge pattern that encapsulates all the NS stuff, but I can't shake
the feeling that this has already been done.  What am I missing?

Thanks,
- Joe



--
View this message in context: http://mono.1490590.n4.nabble.com/System-Drawing-on-Cocoa-tp4659148.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list