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

Geoff Norton gnorton at novell.com
Fri Nov 2 15:45:17 EDT 2007


> 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

Yes its preferred, but completely unpractical for MWF because we need to
support people drawing to a handle at ANY time (Graphic g =
Graphics.FromHwnd (handle); codepath).  As such we've implemented our
own clipping engine and we get the cgcontext from the window port when
someone creates the graphics handle, clip to the viewable region of the
handle and draw.  In fact aside from borders I dont think we do ANY
drawing in the paint event.  Take a look at carbonFunctions.cs in
System.Drawing for the MEAT of this (warning, its in heavy flux so its a
little ugly and inefficient for now).

As such we dont really need to worry about saving and restoring
gstate's; but I should probably do that before Graphics.Dispose and in
the ctor just for the sake of completeness.


More information about the Mono-winforms-list mailing list