Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!vsi1!daver!athsys!jim From: jim@athsys.uucp (Jim Becker) Newsgroups: comp.windows.x Subject: How do I dynamically convert Sun Pixrects to X Pixmaps? Message-ID: <242@tityus.UUCP> Date: 15 Feb 89 22:03:43 GMT Organization: Athena Systems, Inc., Sunnyvale, CA Lines: 44 I need to convert the data bytes stored in a standard Sun Pixrect format to a XImage/Pixmap format on the fly. I use pr_load() to get the bytes into memory, but their format is somewhat different from that that X expects. Does anyone out there know what the magic transformation is, or have a chunk of code that does this? This is for a context sensitive help system that includes text and graphics. I started out using XImages for the graphical storage, but the ASCII version is just too big compared to Pixrect screen snapshots. I'm now trying to load and convert the Sun Pixrect files on the fly into X entities. The current code that I have, which does something close, is: struct pixrect *newpict; XImage *ximage; int w,h; . . . . . . w = newpict->pr_size.x; h = newpict->pr_size.y; ximage->data = newpict->pr_data; ximage->width = w; ximage->height = h; ximage->format = ZPixmap; ximage->byte_order = MSBFirst; ximage->bitmap_pad = 16; ximage->bitmap_bit_order= MSBFirst; ximage->bytes_per_line = (w + 7) / 8; Thanks! -Jim Becker ...!sun!athsys!jim