Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!apple!agate!helios.ee.lbl.gov!epb2.lbl.gov!envbvs From: envbvs@epb2.lbl.gov (Brian V. Smith) Newsgroups: comp.windows.x Subject: XCopyPlane() on color Vaxstation 2000s Keywords: broken? Message-ID: <4088@helios.ee.lbl.gov> Date: 31 Oct 89 18:03:46 GMT Sender: usenet@helios.ee.lbl.gov Reply-To: envbvs@epb2.lbl.gov (Brian V. Smith) Organization: Lawrence Berkeley Laboratory Lines: 68 Ok, I give up. Is XCopyPlane() broken on color Vaxstation 2000s (4-plane)? I have a simple client which just displays a bitmap file in a window. I call XReadBitmapFile() and create a GC with BlackPixel and WhitePixel as foreground and background respectively. Then, AFTER RECEIVING AN EXPOSE EVENT, I just use XCopyPlane to display the exposed part of the pixmap. It works fine on our monochrome Vaxstation 2000s, but not on the color. Here is the important part of the program: Display *disp; int width, height; Pixmap picture; Window win = (Window) 0; GC gc; XGCValues gcval; main() { if ((disp=XOpenDisplay("")) == NULL) { fprintf(stderr, "Couldn't open DISPLAY\n"); exit(1); } if (XReadBitmapFile(disp,RootWindow(disp,0),file, &width,&height,&picture,NULL, NULL) != BitmapSuccess) { fprintf(stderr, "Bad bitmap file: %s\n", file); exit(1); } gcval.foreground=BlackPixel(disp,0); gcval.background=WhitePixel(disp,0); gcval.line_width = 1; gcval.function = copyfunc; if ((gc = XCreateGC(disp,RootWindow(disp,0),GCFunction|GCLineWidth| GCForeground|GCBackground,&gcval))==False) { fprintf(stderr,"Error in creating GC\n"); exit(1); } win = XCreateSimpleWindow(disp,RootWindow(disp,0), 0, 0, width, height, 1, BlackPixel(disp,0), WhitePixel(disp,0)); XStoreName(disp, win, "Xbitmap"); XMapRaised(disp,win); XSelectInput(disp, win, ExposureMask|ButtonPressMask|KeyPressMask); for (;;) { XNextEvent(disp, &ev); if (ev.type == Expose || ev.type== GraphicsExpose) drawPicture(0, ev.y, width, ev.height); } } drawPicture(x, y, w, h) { XCopyPlane(disp, picture, win, gc, 0, y, w, h, 0, y, (unsigned long) 1); XFlush(disp); } _____________________________________ Brian V. Smith (bvsmith@lbl.gov) Lawrence Berkeley Laboratory I don't speak for LBL, these non-opinions are all mine.