Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!umd5!purdue!gatech!bbn!diamond.bbn.com!mlandau From: mlandau@bbn.com (Matt Landau) Newsgroups: comp.windows.x Subject: Re: XCreateBitmapFromData() bug/feature question Message-ID: <10572@jade.BBN.COM> Date: 5 Feb 88 00:45:52 GMT References: <8802042049.AA06105@amadeus.silvlis.com> Reply-To: mlandau@bbn.com (Matt Landau) Organization: BBN Laboratories Incorporated, Cambridge, MA Lines: 16 In comp.windows.x, mdb@amadeus.UUCP (Mark D. Baushke) writes: >I have a sequential stream of bytes which I want to make into an icon. > >On my Sun, I need to 'swap' the bytes on each 'short' word in order to >make the image look correct. However, I am told that the image is ok >"as is" on uVAX so changing the data to make it look good on a sun >will break it for a VAX... Requiring the application to alter the bit >data depending on the hardware in use is not something I am very fond >of doing. One portable way of doing this is to use XCreateImage to make an XImage structure, then use XPutImage to stuff it into a window or pixmap. You get to specify the bit- and byte-sex of the data in XCreateImage, so this works everywhere. -- Matt Landau Waiting for a flash of enlightenment mlandau@bbn.com in all this blood and thunder