At Mon, 6 Jun 2016 16:45:33 -0400, David Raymond Christiansen wrote: > I'm looking for a way to check whether a mouse pointer is on top of a > particular pict that has been drawn to a canvas%. > > Right now, the best I've been able to do is to render the pict to two > off-screen bitmaps with different background colors, and then check > whether or not the pixel on each bitmap that corresponds to the mouse > location in the canvas is the same as the bitmap's background color. > > I use two bitmaps in case a region drawn by the pict is the same color > as the background that I have chosen. Given that there's support for the > dc pict, which uses arbitrary imperative commands for drawing, I doubt > that I can do better than this, but I'd appreciate hearing any > techniques that I'm missing.
If I understand the goal, you could render to one bitmap that has an alpha channel, and then check whether the pixel under the mouse ends up with a non-zero alpha. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.