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

Maxi Combina maxi.combina at passwordbank.com
Thu Jul 21 02:00:43 EDT 2011


Hi,

please excuse if my suggestion is too newbie but, can't you
ship libfreetype.6.dylib with your app?

Regards,
maxi

2011/7/20 Eric J. M. Smith <eric at tarkvara.org>

> Hi everybody,
>
> Clay Fowler was able to provide more information about the drawing
> bridge (appended to the end of this message).  The good news is that
> the functionality is already built into MonoMac using
> Graphics.fromHwnd().  The bad news is that it depends on the user
> having X11 installed, as well as a version of libfreetype.6.dylib
> which is newer than the one included with Apple's X11.
>
> Hope that helps,
>
> Eric Smith
> Tarkvara Design Inc.
>
>
> On 18 July 2011 17:29, Clay Fowler wrote:
> > Rendering in a NSView with System.Drawing is very simple and performs
> > extremely well. We also have cross-platform rendering in our products. To
> > use it, just enable the bridge with one line of code in the Main of your
> > project:
> > NSApplication.InitDrawingBridge();
> > (... we do this right after NSApplication.Init() and
> > before NSApplication.Main(args)).
> > Then override DrawRect in your custom NSView classes and do this:
> > public override void DrawRect(RectangleF rect)
> > {
> > if (Handle != IntPtr.Zero)
> > {
> > using (Graphics g = Graphics.FromHwnd (Handle))
> > {
> >                     // ... Normal drawing here...
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>



-- 
*Maxi Combina*
Cell:+1 408 300 3614
Tel:  +1 408 524 1579
440 N. Wolfe Road. Sunnyvale. CA. 94085. USA

<http://www.passwordbank.com/>www.PasswordBank.com<http://www.passwordbank.com/>
This message and its attachments are sent from PasswordBank, Inc. and may
contain information that is
confidential. If you are not the intended recipient, you are prohibited from
printing, copying, forwarding or
saving them. Please delete the message and attachments without printing,
copying, forwarding or saving
them, and notify the sender immediately. Message transmission is not
guaranteed to be secure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110721/6fce6a7c/attachment-0001.html 


More information about the Mono-osx mailing list