Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!mordor!sri-spam!ames!nrl-cmf!cmcl2!husc6!bbn!uwmcsd1!ig!agate!ucbvax!ATHENA.MIT.EDU!newman From: newman@ATHENA.MIT.EDU Newsgroups: comp.windows.x Subject: Re: XCreateBitmapFromData() bug/feature question Message-ID: <8802042313.AA08403@LEO.MIT.EDU> Date: 4 Feb 88 23:13:28 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 21 You are having byte-order difficulties because you are passing XCreateBitmapFromData() an array of 'short', when it wants an array of 'char'. To make your application run portably, you need to convert your X10-format bitmap files to X11 format. As you know, X10 bitmap files declared the "_bits" variable as an array of "short", which is normally 16 bits. That was fine then, because X10's XBitmapBitsPut() routine expected 16-bit data too, and the server took care of any needed byte-swapping if the client and server had different byte orders. In X11, however, bitmap files declare the _bits array as an array of 'char'. This means the data is now in 8-bit format, and is independent of the client machine's byte order. That is the format that XCreateBitmapFromData() wants to see; it assumes that bitmap_unit=8 (NOT that bytes_order=LSBFirst). To convert an X10 bitmap file to X11 format, use the "bm-convert" utility to convert your favorite X10-format bitmap file to X11 format. You should find "bm-convert" in the util/ subdirectory of your X11 distribution. /Ron Newman