Xrender related question

Alexei Babich a.babich at rez.ru
Mon Feb 23 22:52:59 PST 2009

Hello, all.

Having executed a piece of code listed below, I get a green window (as a result of calling XCreateSimpleWindow()) and a black rectangle on top of it (XRenderFillRectangle()). I still get just black, whatever color I set in the 'col' structure.
XRenderFindVisualFormat() points to the data field shown on the screenshot attached to this letter. 
Why doesn't the color of the rectangle depend on the 'col' parameters?

Thank you.

XRenderColor col;

//create simple window (near green background color) at x,y = (20,30) and width,height = (300,200)
abc = XCreateSimpleWindow(display, DefaultRootWindow(display), 20,30, 300,200,0,0,30000);
XMapWindow(display, abc);

//create default picture         
pict = XRenderCreatePicture(display, abc, XRenderFindVisualFormat(display, visual), 0, NULL);

//some color
col.red = 0;
col.green = 127;
col.blue = 250;
col.alpha = 250;

//fill rectangle at x,y=(20,30) and width,height=(40,50) with selected color
XRenderFillRectangle(display, PictOpSrc, pict, &col, 20,30,40,50);

Alexei Babich, circuit engineer, OOO NPP "Rezonans", Chelyabinsk, Russia
Jabber ID: impatt at jabber.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1_.png
Type: image/png
Size: 2322 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20090224/ad8d746e/attachment.png>

More information about the xorg mailing list