[Xcb] dealing with colors

Jean-Loup Defaisse jloupdef at gmail.com
Thu Aug 7 07:13:11 PDT 2008


the code of julia.c doesn't help me because it use XCBImagePutPixel  and the
color is directly given in parameter, but I'm drawing directly in the window
using xcb_poly_segment, xcb_poly_point... and the color can't be given
directly. That's why i'm looking to a function corresponding to
XSetForeground to select the color i want.
I hope i'm clear enough, else i'll try to simplify my program to post it
here when i have time.

2008/8/7 Vincent Torri <vtorri at univ-evry.fr>

>
> Hey,
>
>
>  I started few days ago a gui creation with Xlib, but i found xcb yesterday
>> and decided try it. I modified my code quiet easily (it wasn't really
>> long)
>> except for the color. How should i replace
>>   XAllocColor(WinInf->dpy, WinInf->cmap, &c);
>>   XSetForeground(WinInf->dpy, WinInf->gc, c.pixel);
>>
>> I tried by using xcb_alloc_color but i didn't succeed (all my drawings
>> were
>> black).
>>
>> Any idee?
>> Else, is there a simple example just drawing colored points in an empty
>> window?
>>
>
> see in demo/ the code of 'julia.c'
>
> Vincent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xcb/attachments/20080807/b8f39fe1/attachment.html 


More information about the Xcb mailing list