[Mono-winforms-list] Project status of WinForms on MacOS

Geoff Norton gnorton at novell.com
Fri Nov 2 16:05:14 EDT 2007


Stefan,

	I was sure I replied to this but I can't find it in my sent box or on
the list, so if this is a dupe I apologize.

On Fri, 2007-11-02 at 20:34 +0100, Stefan Csomor wrote:

> if you have a CGContextRef for drawing while being in a paint event, 
> then this is preferred (especially because of the artefacts occuring if 
> you double draw with a transparent background), then you can use the cg 
> from the event directly (kEventParamCGContextRef) , but if you cannot - 
> being out of the paint event, you will have to setup something like
> 

We do little to no painting inside the apple provided loop.  We need to
support the following call pattern:

Graphic g = Graphics.FromHwnd (handle);

which can be called at any time anywhere. As such we do (sort of) what
you suggested below already today:

> CGContextRef cgContext;
> OSStatus status = QDBeginCGContext( GetWindowPort( m_windowRef ) , 
> &cgContext);
> 
> ... do the drawing ...
> 
> QDEndCGContext( GetWindowPort( m_windowRef ) , &cgContext);
> 

If you're curious what we're doing you can look at carbonFunctions.cs in
System.Drawing for our rough and optimizable implementation :)  We have
a few more clipping cases to cover off but its gotten us to where we are
today.

-g




More information about the Mono-winforms-list mailing list