[英]How can I limit the surface in which Xlib graphics primitives draw?
我認為這就是剪輯的用途,但我找不到任何示例可以做到這一點。 我需要:
您可以通過做XSetClipRectangles()
引用在這里和XSetClipMask()
引用在這里
所以:
Display dpy; //This is your display, we'll assume it is a valid Display
GC gc; //This is your GC, we'll assume it is a valid GC
XRectangle recs[]; //This is an array containing the clipping regions you want.
int recs_n; //This is the number of rectangles in the 'recs' array.
XSetClipRectangles(dpy, gc, 0, 0, recs, recs_n, Unsorted); //Enable clipping
drawMyClippedGraphics(); //Call to whatever you want to use for drawing
XSetClipMask(dpy, gc, None); //Restore the GC
有關更多信息,請在終端中輸入man functionName
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.