Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!csn!samwise!devin From: devin@samwise.Colorado.EDU (Yampalimardilor) Newsgroups: comp.windows.x Subject: XPutImage problem Keywords: XPutImage into a 1-deep Pixmap Message-ID: <1991Jan14.044003.29147@csn.org> Date: 14 Jan 91 04:40:03 GMT Sender: news@csn.org Reply-To: devin@boulder.Colorado.EDU Organization: University of Colorado, Boulder Lines: 37 Nntp-Posting-Host: samwise.colorado.edu This piece of code generates a BadMatch. What am I doing wrong? (I'm running vanilla MIT X11R4) I'm trying to XPutImage an image into a 1 plane Pixmap. If I comment out the XPutImage, the BadMatch goes away, so I assume that it this particular call that's doing it. *** Start code map = XCreatePixmap(_display,DefaultRootWindow(_display), defaultwidth,defaultheight,1); char *mapdata = new char[defaultwidth*defaultheight]; if ((fp = open(pathname,O_RDONLY)) < 0) { // ERROR delete mapdata; return; } if (read(fp,mapdata,defaultwidth*defaultheight) < 0) { // ERROR delete mapdata; return; } XImage *txi = XCreateImage(_display,_visual,1,XYBitmap,0,mapdata, defaultwidth,defaultheight,8,defaultwidth); for (int i=0;i