我希望的行为是有一个我可以绘制的屏幕外图片,然后使用XComposite将其绘制到屏幕上的窗口.有没有办法让屏幕外的图片与根窗口大小相同?
到目前为止(此代码在无限循环中运行):
Window root,parent,*children;uint children_count;XqueryTree(disp,DefaultRootwindow(disp),&root,&parent,&children,&children_count);// I'd like the following picture to be offscreen.// I SUSPECT that I have to put else something where rootPicture is// Currently,when I draw to this picture,X11 renders it to the screen immediately,which is what I don't want.Picture pictureBuf = XRenderCreatePicture(disp,/* rootPicture */,XRenderFindVisualFormat(disp,DefaultVisual(disp,DefaultScreen(disp))),cpsubwindowMode,&RootAttributes);for (uint i = 0; i < children_count; i++) { // collapsed some stuff that doesn't matter Picture picture = XRenderCreatePicture(disp,children[i],pictureFormat,&pictureAttributes); // The following line should composite to an offscreen picture XRenderComposite(disp,hasAlpha ? PictopOver : PictopSrc,picture,None,pictureBuf,windowRect.x(),windowRect.y(),windowRect.wIDth(),windowRect.height()); // collapsed some stuff that doesn't matter}// The following line should composite from the offscreen picture to an onscreen pictureXRenderComposite(disp,PictopSrc,rootPicture,RootAttr.x,RootAttr.y,RootAttr.wIDth,RootAttr.height);解决方法 我最近在寻找类似的东西,并认为我会回复.下面的代码片段显示了如何从现有窗口创建新的像素图,而无需直接绘制到该窗口.希望这会有所帮助.
pixmap new_pixmap;new_pixmap = XCompositenameWindowpixmap( display,src_window);Drawable draw = new_pixmap;if (!draw) draw = src_window;Picture origin;origin = XRenderCreatePicture( display,draw,format,cpsubWindowMode,&attributes);总结
以上是内存溢出为你收集整理的c – XRender创建屏幕外图片全部内容,希望文章能够帮你解决c – XRender创建屏幕外图片所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)