Re: one more time about color (colour)



On 10/20/06, konrad kwaskiewicz <konrad kwaskiewicz gmail com> wrote:
hi
I need to get Color from selected point (x,y) on drawing area
(not using ColorButton, just knowing [x,y])
is there some function like drawingarea.getColor(int x,int y)
or any other possibility to take color from one point?
it would be grate if someone knows an example
thanks


I've not personally done this, but the GTK+ colorselector widget has a
little "dropper" button that lets you click anywhere on the screen to
get the color at the point where you click.  So you might look at the
GTK+ source for inspiration and then convert that to gtkmm.  It
doesn't look like they use any internal API so it should be pretty
easy.  Look for the function "grab_color_at_mouse()" in the following
file: http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkcolorsel.c?rev=1.150&view=markup

Hope that helps.

--
jonner



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