Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!gatech!bloom-beacon!SABER.COM!jimf From: jimf@SABER.COM Newsgroups: comp.windows.x Subject: Re: XImages Message-ID: <9012101728.AA23279@test4> Date: 10 Dec 90 17:28:11 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 34 |So you have only two real possibilities. One is that you can massage |your data into whatever format the server you happen to be connected to |wants. The other is to write your own functions to stuff into the |function handles, allocate the XImage structure yourself, and use |whatever data layout happens to be convenient. | |IMO this is a botch. It should be possible to use your own preferred |data layout and have Xlib do whatever is necessary to accomodate it. |It more or less has to do this anyway, because the handles do not |include functions for PutImage and GetImage format conversion. Yea, the XImage stuff is not well designed or documented. It's highly portable, though, to allocate an XImage and smash the attributes you want into the structure. Xlib (at least all of them I've used) will convert to server-natural format for you. This is highly convenient because all you have to do is describe what your image looks like and send it off. Sample code which does this can be had from expo.lcs.mit.edu in /contrib/xloadimage.2.02.tar.Z. Look at send.c. While I admit that it's not the cleanest way to do things and it doesn't seem to be guaranteed that Xlib will convert for you, it does work very portably (ie I know of no system which doesn't convert, and xloadimage runs on a *lot* of systems). Nice description, BTW. I would have killed for that a couple of years ago :-). Happy hacking, jim frost saber software jimf@saber.com