On 6/7/2016 3:40 PM, David Christiansen wrote:
> Understood.  Is it possible to define a region to represent the
> clickable areas?  This is the way I would do it if possible.
>
> I haven't done much GUI programming in Racket, so I don't know exactly
> what it can do, but in, e.g., Windows GDI you can create a region
> directly from a binary (1-bit depth) bitmap [and a bitmap of any depth
> can be converted to a binary bitmap].  Set (1) pixels in the bitmap will
> be included in the region and unset (0) pixels will be excluded.

I don't know of a way to do this, other than what I've been doing with
an off-screen buffer for each mouse-sensitive pict. But thanks!

/David

Looking at the docs for region%, Racket doesn't have a simple way to do this - it still could be done by force and might not be that slow depending on the complexity of the "scene" in the image. If you're familiar with image processing, the basic idea is recursive "blob" identification.

I saw in your reply to Matthias that you are "drawing" the pictures into an offscreen bitmap. I know that word "drawing" is overloaded: did you mean you loaded a bitmap (from a file?) and made an offscreen copy, or that you are composing the image with pen/brush. Reason I ask is that if you are composing, constructing a corresponding region% might be relatively easy.

George

--
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.

Reply via email to