RE: How to use the GdkColor.pixel
- From: Owen Taylor <otaylor redhat com>
- To: Tom Liu <tom liu flextrade com>
- Cc: gtk-app-devel-list gnome org
- Subject: RE: How to use the GdkColor.pixel
- Date: Thu, 11 Dec 2003 12:54:37 -0500
On Thu, 2003-12-11 at 12:14, Tom Liu wrote:
Thanks!, I understand now.
But, how to get the rgb value of a allocated color? In my application, I
allocated a lot of color when I start program, should I use RGB value?
I'd just use RGB values and let GTK+ worry about allocating them,
normally. (gdk_colormap_query_color() can be used to find the RGB
of an allocated color.)
How about for performance? Every time to use GdkColor in GTK+,
internally it need to go alloc the color, will this slow down?
On any modern display (TrueColor), gdk_colormap_alloc_color()
is really fast - it's just a few bitshifts.
But even on older pseudo-color displays, letting GTK+ allocate
the color will generally be quite fast enough ... if the color is
already in use, it can find it without having to ask the X server to
allocate a new color.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]