BUG: wxMac 2.8.0 drawing sample, logical op

phoenix phoenix at amule.org
Tue Jan 23 20:36:28 PST 2007


Hi Thomas,

I have recently found a problem with wxMac drawing, probably the same
problem. Look at these messages from the developers list. If you find a
good solution, please post it here.

To summarize, it seems that CoreGraphics, the new Mac drawing engine,
does not support logical operations.

Best regards,
Phoenix.

On Tue, 2007-01-09 at 15:16 -0200, phoenix wrote:
> Hi Stefan,
> 
> I hope you don't mind that we bring it back to the list.
> 
> On Tue, 2007-01-09 at 15:18 +0100, Stefan Csomor wrote:
> > Hi Phoenix
> > 
> > Enjoy your holidays, here was the answer line :
> > 
> > > > What exactly is your code looking like, then perhaps I can offer
> > > you an
> > > > alternative.
> > > 
> > > I am working with 3 memory DC's (memDC, dcGrid, dcPlot) like this:
> > > 
> > > memDC->Blit(0,0,nClientWidth,nClientHeight,dcGrid,0,0);
> > > memDC->Blit(0,0,nClientWidth,nClientHeight,dcPlot,0,0,wxOR);
> > > 
> > > I think it is strange that the second line of this code fails for
> > > memory
> > > DC's. Ok, CoreGraphics does not support anything but copy, but memory
> > > DC's should not have this restriction, should they? I should be able
> > > to
> > > manipulate the images in memory and then the last step would be a
> > > copy
> > > to the actual display device.
> > > 
> > > Anyway, what is your suggestion in this case? If memory DC's do not
> > > support raster operations, I think I would have to change the drawing
> > > logic. The even more strange thing is that this code works with
> > > wx-2.6.3, the odd behaviour is only with wx-2.8.0.
> > 
> > 2.6.3 was using the venerable QuickDraw, 2.8.0 is using CoreGraphics, as
> > all the QuickDraw calls are deprecated and may not be available on
> > future systems ...
> > 
> > So the deeper question is what exactly are you XOR blitting, for most
> > things I've been using wxOverlayDC, which even gave the nicer mac look,
> > as this is a real overlay dc so rectangles etc can be semi transparently
> > filled etc...
> 
> Well, my concern is how do I code it so that I achieve platform
> independency. You see, this code is supposed to run in at least 3
> platforms: Windows, GTK and Mac.
> 
> This is a simple "moving graph" plot. One DC has the fixed elements, the
> axis, scales, labels, etc, the other has the moving stuff, basically the
> curves. They get combined with the wxOR (not wxXOR), because the person
> that originally coded assumed a black background.
> 
> I will take a look at wxOverlayDC when I come back.
> 
> Thank you very much for your help!
> Best regards,
> Phoenix.
> 
> > 
> > Best,
> > 
> > Stefan






More information about the wx-users mailing list