Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!bcm!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Re: X window Message-ID: <2961@gazette.bcm.tmc.edu> Date: 29 Nov 90 21:19:24 GMT References: <169@nys138.nysnet.nysnet> Sender: usenet@bcm.tmc.edu Reply-To: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Organization: Baylor College of Medicine, Houston, Tx Lines: 39 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu You have already posted this note. There are many problems with your code segment : Problem #1 : XReadBitmapFile does not read TIFF. Problem #2 : In exposeHandler, you begin setting the fields pointed to by image, but that pointer is UNITIALIZED. You should not use a pointer in this example. Use the whole structure (change XImage *image to XImage image and change image-> to image.) Also, your function block is not there. Bus Error is the likely result. Problem #3 : You should construct your XImage ahead of time. You should not do it every time your widget is exposed. Problem #4 : You are cramming a pointer to a pixmap into the image->data field. This is wrong, wrong, wrong. A Pixmap is completely different from image data. Use XGetImage to get an image from a pixmap. You don't really, have to mess with XImages at all if you already have a bitmap. Use XCopyArea or XCopyPlane instead. If you have a tiff file already, convert it to a ppm file and use xloadimage. If you have xtiff, you could display the image using that. -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bmc.tmc.edu (713) 798-3776