earle@mahendo.Jpl.Nasa.Gov (Greg Earle) (09/15/88)
In article <8809131605.AA01736@EXPO.LCS.MIT.EDU> jim@EXPO.LCS.MIT.EDU (Jim Fulton) writes: > o when creating a pixmap from single plane (e.g. "bitmap") data, use > XCreatePixmapFromBitmapData; this will be easier in R3 as there will > a library of miscellaneous utility routines that will include a call > for reading bitmap data from files. Until then: > > o if you have a bitmap (i.e. single-plane pixmap) that you need to turn > into a two color, multi-plane pixmap, create a scratch GC with > foreground and background set to the appropriate colors and > graphics_exposures set to False; create a pixmap of the appropriate > size using XCreatePixmap; then, do an XCopyPlane from the bitmap > to the pixmap and free the scratch GC. Somewhat related to this, I have two questions: (1) I wanted to hack `xsetroot' to keep it from tiling the background pixmap. This would be desirable for those larger scanned backgrounds (like `twodollar') that take up most of (anybody's) the screen, but end up being tiled with 3 slivers taking up the remaining root window. I wanted to center the bitmap in the pixmap, and leave the rest of the pixmap alone (gc_init.background). But I get the impression that merely centering the bitmap into the background pixmap with XCopyPlane will still tile anything left over anyway (I assume this from the XCopyArea documentation, and the behavior of `xsetroot -bitmap'). Is there any way to get around this, and do what I want? It seems that tiling the background pixmap is a good idea for small (like icon-sized) bitmaps, but not necessarily for large almost-full-screen ones. Yes? Will this be an available option in the R3 `xsetroot'? If so, how is it done? :^) (2) Even more naive question: I see all this stuff about setting the background Pixmap via XSetWindowBackgroundPixmap(), but I don't see any support for color pixmap *files*, only monochrome bitmap files. Am I missing something? Is it true that X is like SunView, in that it cannot support arbitrary 8 bit images (in some acceptable format) as window backgrounds because of this? With NeWS one can use an arbitrary image in Sun rasterfile format as the root background image, and it can be either 1 bit deep or 8 bits, it doesn't matter. I was hoping I could take some nice Abel Image Research still frame rasterfiles and use them as color X backgrounds. First I discover that there is no `rast8topbm' (my own naming convention there) program, then I discover that it appears that there's no current support for 8 bit pixmap files. Is this true, or did I not RTFM well enough :^( If it is true, will constructs to support saving/restoring color pixmaps (along with their associated color maps, of course) in files be implemented in the future? Thanks, -- Greg Earle earle@Sun.COM Sun Microsystems poseur!earle@mahendo.JPL.NASA.GOV Los Angeles Consulting earle%mahendo@elroy.JPL.NASA.GOV ...!{cit-vax,ames}!elroy!poseur!earle ...!sun!tsunami!valley!poseur!earle
swick@ATHENA.MIT.EDU (Ralph R. Swick) (09/23/88)
Date: Thu, 22 Sep 88 10:52:07 PDT From: Greg Earle <earle@mahendo.jpl.nasa.gov> (2) Even more naive question: I see all this stuff about setting the background Pixmap via XSetWindowBackgroundPixmap(), but I don't see any support for color pixmap *files*, only monochrome bitmap files. Correct. Even the current support (both varieties) for monochrome images is a crock. If it is true, will constructs to support saving/restoring color pixmaps (along with their associated color maps, of course) in files be implemented in the future? I sure hope so. One of the reasons image interchange support is not currently implemented is that we've been waiting for the experts (:-) on the subject to decide which of the many image file formats they can agree to adopt. Several individuals have made stabs at a common image file format for X, but none have ever been completed. Interested/ capable assistance is always welcome...