|
|
Řádka 57: |
Řádka 57: |
| | | |
| 크노픽스(Knoppix)는 리눅스 배포판 가운데 하나다. | | 크노픽스(Knoppix)는 리눅스 배포판 가운데 하나다. |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }#include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
− | #include <stdlib.h>
| |
− | #include <stdio.h>
| |
− |
| |
− | #include <X11/Xlib.h>
| |
− |
| |
− | Display *dpy;
| |
− | Window wind,rootwind;
| |
− | GC gc;
| |
− | XImage *xip;
| |
− | Drawable d, d_in;
| |
− | unsigned long plane_mask = -1;
| |
− | XGCValues xgcvalues;
| |
− | int screen;
| |
− | Window rootwind;
| |
− | unsigned long White,Black;
| |
− | XEvent ev;
| |
− |
| |
− | main(int argc, char**argv){
| |
− | d_in = strtol( argv[1]+2, NULL, 16 );
| |
− |
| |
− | if ( !(dpy = XOpenDisplay(":0") )){
| |
− | fprintf(stderr,"Cannot open display\n");
| |
− | exit(-1);
| |
− | }
| |
− | fprintf(stderr,"Display connected OK\n");
| |
− | fprintf(stderr,"Copying window 0x%x\n", d_in);
| |
− |
| |
− | screen = DefaultScreen(dpy);
| |
− | rootwind = RootWindow(dpy,screen);
| |
− | White = WhitePixel(dpy,screen);
| |
− | Black = BlackPixel(dpy,screen);
| |
− |
| |
− | gc = XCreateGC(dpy, rootwind, 0, &xgcvalues); /* mask=0, use nothing from xgcvalues */
| |
− | XSetFunction( dpy, gc, GXcopy );
| |
− |
| |
− | XSetForeground( dpy, gc, Black );
| |
− |
| |
− | d = XCreateSimpleWindow(dpy,rootwind,5 /*x*/,20 /*y*/,400,200,10 /*?*/,Black,White);
| |
− | XMapWindow(dpy,d);
| |
− |
| |
− | XSelectInput(dpy,d,ExposureMask|ButtonPressMask|ButtonReleaseMask|StructureNotifyMask|
| |
− | SubstructureNotifyMask);
| |
− |
| |
− | XNextEvent(dpy,&ev);
| |
− | while (ev.type != MapNotify) XNextEvent(dpy,&ev);
| |
− |
| |
− | XDrawLine(dpy,d,gc,10,20,40,60);
| |
− |
| |
− | while (1){
| |
− | fprintf(stderr,".");
| |
− | fflush(stderr);
| |
− | XNextEvent(dpy,&ev);
| |
− |
| |
− | xip = XGetImage(dpy, d_in, 0, 0, 400, 200, plane_mask, ZPixmap);
| |
− |
| |
− | int c;
| |
− | // CHANGE IMAGE HERE
| |
− | for( c=0; c < 70000; c+=4 ){
| |
− | unsigned char r, g, b;
| |
− | b = (xip->data)[c];
| |
− | g = (xip->data)[c+1];
| |
− | r = (xip->data)[c+2];
| |
− | r=g=b=(r+g+b)/3;
| |
− | (xip->data)[c] = b;
| |
− | (xip->data)[c+1] = g;
| |
− | (xip->data)[c+2] = r;
| |
− | (xip->data)[c+3] = 0;
| |
− | }
| |
− |
| |
− | XPutImage(dpy, d, gc, xip, 0, 0, 20, 20, 400, 200);
| |
− | }
| |
− | exit(0);
| |
− | }
| |
Tohle je pískoviště na pokusy. Editujte dle libosti.
Kus textu nad nadpisem.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Galia es omnis Divisa in Partes trees, quarum unam incolunt Belgae, nostra Galli appelantur...
Knoppix ist eine freie GNU/Linux-Distribution, die sich als Live-System direkt von einer CD, DVD oder Flashdisk (=USB-Stick) starten lässt.
Xin chào các bạn tới Website Knoppix Tiếng Việt. Vietnamese KNOPPIX là kết quả của chương trình hợp tác công nghệ thông tin giữa Viện Khoa
وتستخدم نظام إدارة الحزم الخاص بها. تمتاز نوبكس بخاصية التعرف التلقائي Knoppix على مكونات الحاسوب.!!!!!!!!
크노픽스(Knoppix)는 리눅스 배포판 가운데 하나다.