Re: Drawing area feature?



Thanks for your explanation but I will appreciate more details.

Use a double buffer and draw your objects in the back buffer,
(exactly as in a normal draw), each object with a different color.
Then you just have to compare the color of the pixel where the
user clicked with the color of the objects, to see which one
was selected.

I know the gdk_image_get_pixel function but it applies on a GdkImage. I
can build the GdkImage with something like that:
gdk_image_get(  widget->window,
                event->button.x,
                event->button.y, 1, 1);
Where widget is the drawing area. But I don't find a way to retrieve the
pixel color on a GdkPixmap (the back buffer). A clue?

Clement.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]