Re[2]: question: colors, visuals, please help to understand
- From: Alexander Chemeris <chemeris mail ru>
- To: gtk-list gnome org
- Subject: Re[2]: question: colors, visuals, please help to understand
- Date: Thu, 22 Aug 2002 19:33:13 +0400
Thursday, August 22, 2002, 3:34:15 PM, you wrote:
> Alexander Chemeris wrote:
>>Tuesday, August 20, 2002, 2:37:25 PM, you wrote:
>>> I need to allocate colors in PseudoColor and change their values
>>>in runtime (gtk+-2.0). GDK allows me to allocate a writeable colors
>>>in colormap via gdk_colormap_alloc_colors. But the problem is all
>>>functions I've found are deprecated: gdk_colors_store,
>>>gdk_color_change, gdk_colormap_change.
>>See for GdkRGB part of Gdk.
> There's no direct support for writeable colours in GdkRGB.
>>Function used to allocate colors here is gdk_rgb_find_color().
> Allocate - yes, but not to change the value of previously allocated
> writeable colour. I need to have a constant pixel value (initialized
> by gdk_colormap_alloc_colors in startup time) and ability to change
> the R/G/B values of this pixel. I can't find non-deprecated
> functions to do this - that's the main reason of my screams.
Hmm, why do you need writable colors?
May be cmaps would help you?
See gdk_rgb_cmap_new()/gdk_rgb_cmap_free() and gdk_draw_indexed_image()
There isn't much documentation, but I think it all you need:
Allocate cmap, fill it with your colors, and then, when you need to
change color use something like this:
your_cmap->colors[color_number] = (r<<16) | (g<<8) | b;
I never deal with this, but I saw at the gdk_rgb_indexed_to_stage()
function implementation in gdkrgb.c... ;-)
I think you must dig in the gdkrgb code and when you find appropriate
way - document it. ;-)
Alexander Chemeris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]