what is the pixel value of the GdkColor ?
- From: Sven LUTHER <luther maxime u-strasbg fr>
- To: gtk-list redhat com
- Cc: luther dpt-info u-strasbg fr
- Subject: what is the pixel value of the GdkColor ?
- Date: Wed, 26 May 1999 15:12:29 +0200
Hello, ...
What is contained in the pixel value of the Gdkcolor type ?
also what is the correct way of writing a colored point onto a pixmap ?
is it :
----------------------------------------
color =
{
/* what is the value in pixel ? */
pixel = ?;
red = r;
green = g;
blue = b;
}
/* is it necessary to put the color in a colrmap, or could i do without it ? */
colormap = gdk_window_get_colormap ((GdkWindow *)pixmap) ;
/* what is the meaning of writeable and best_match ? */
gdk_colormap_alloc_color (colormap, &color, writeable, best_match);
gc = drawing_area->style->fg_gc[GTK_WIDGET_STATE(drawing_area)];
gdk_gc_set_foreground (gc, &color);
gdk_draw_point ((GdkDrawable *)pixmap, gc, x, y);
----------------------------------------
Later when i want ot retrieve the color associated with a pixel of the pixmap,
do i do :
----------------------------------------
image = gdk_image_get ((GdkWindow *)pixmap, 0, 0, x+1, y+1);
pixel = get_image_get_pixel (image, x, y);
----------------------------------------
how can i get back to the GdkColor value associated with said pixel.
Did i mess things up here ? is there some clear documentation on this somewhere
?
Friendly,
Sven LUTHER
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]