Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function xy ( window w ) // wich is the aplication window
- XWindowAttributes x_window_attrs;
- CHECK(XGetWindowAttributes(display_, w, &x_window_attrs));
- const Window frame = XCreateSimpleWindow(
- display_,
- root_,
- x_window_attrs.x,
- x_window_attrs.y,
- x_window_attrs.width,
- x_window_attrs.height,
- BORDER_WIDTH,
- BORDER_COLOR,
- BG_COLOR);
- XSelectInput(
- display_,
- frame,
- Somemask);
- // here is my helpless try to copy images from one frame to another
- // 1. i loop over the size of the image
- // 2. i generate a XImage / Pixmap ( non of wich im shure of works just found them in tutorials)
- // 3. do stuff pixel_line by pixel_line
- // 4. trying to reprint it to the window
- for (pixel_row=0; pixel_row < x_window_attrs.height; pixel_row++){
- XImage *img = XGetImage(display_, w, 0, pixel_row, x_window_attrs.width, 1, AllPlanes, XYPixmap);
- Pixmap p = XCreatePixmap(display_, XDefaultRootWindow(display_), x_window_attrs.width, 1, x_window_attrs.depth);
- // do stuff with pixel by pixel line
- XGCValues gcvalues;
- GC gc = XCreateGC(display_, p, 0, &gcvalues);
- XCopyArea(display_, p, w, gc, 0, pixel_row, x_window_attrs.width, 1, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement