Re: NewbieQ: Changing color on drawing primitives



Yup, replying to my own post :)

I worked out how to change the foreground color using
gdk_gc_set_foreground() however, the GdkColor struct has me a bit
confused.

I Have:

GdkColor        color;

color->pixel = 0;
color->red = 65535;
color->green = 0;
color->blue = 0;

gdk_gc_set_foreground(gc, color);
gdk_draw_line(pixmap, gc, 10, 50, 100, 300);

I expected the line drawn to be red, but it was black, I set
color->pixel = 500; and the line was drawn in blue.

What exactly is the pixel element for?
"pixel For allocated colors, the value used to draw this color on the
screen."

Allready allocated colors? How do I specify my own RGB colors?

Any help appreciated,
-Jev

-- 
http://www.ecad.org/~jev/jev.gpg
Key fingerprint = 748B 2346 1683 6384 5E8D  4EE3 0807 EADB 999E AB95




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