Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!sgi!zok!mark From: mark@zok.UUCP (Mark W. Snitily) Newsgroups: comp.windows.x Subject: Re: XPM files into Pixmaps Message-ID: <488@zok.UUCP> Date: 15 Sep 90 07:41:15 GMT References: Organization: The distant planet Zok Lines: 75 In article hallettJ@gemed writes: >I've come into possession of an xpm file containing an icon of the >Porsche shield. It is in four colors and looks like this: > >#define porsche_format 1 >#define porsche_width 64 >#define porsche_height 64 >#define porsche_ncolors 4 >#define porsche_chars_per_pixel 1 >static char *porsche_colors[] = { > " ", "slate blue", > ".", "yellow", > "r", "red", > "b", "black" >}; [rest of porsche xpm icon removed] >Now, how do I load this into X11 (particularly, using Xview) so I can >create a server image out of it? If I can get an X11 Pixmap and color >segment definition, I should be able to use a standard xv_create call >in Xview. However, how do I create an X Pixmap from this in the first >place. > >Thanks in advance. > >-- > Jeffrey A. Hallett, PET Software Engineering > GE Medical Systems, W641, PO Box 414, Milwaukee, WI 53201 > (414) 548-5163 : EMAIL - hallettJ@gemed.ge.com > "Keep that sense of humor. It's critical." This is a rather old news article, but better late than never; I'm really behind in my news reading... In order to display an xpm (version 1) file you should get /contrib/xloadimage.1.06.tar.Z from expo.lcs.mit.edu. Believe version 1.03 is when Jim Frost added the xpm format. Also on expo you'll find /contrib/xpm.tar.Z which contains library routines that understand the format. If you don't have access to the internet you can uucp these files from X11 archive on zok. (Due to System V, filenames are condense.) The following commands will fetch these files: (The "\"'s are csh escapes, ignore them if you're using sh or ksh.) uucp zok\!/usrX/contrib/xldim106.tar.Z \!~ uucp zok\!/usrX/contrib/xpm.tar.Z \!~ See the monthly "Frequently Asked Questions about X with Answers" for info on how to set up a uucp connection to zok. For those of you interested in creating color xpm icons the following might be of interest. I created the above porsche.xpm the 'old fashioned way,' I used emacs. :-) Actually, I used "bitmap" to make a mono version named porsche.xbm and then converted that to xpm with the pbmplus "ppmtoxpm" tool that I wrote earlier this year, (see comp.sources.misc Vol 7, Issue 79, and then Vol 13, Issue 17 for a patchfile). The command used to create the porsche.xpm file was: (all on one line) xbmtopbm porsche.xmb | ppmtoxpm -name porsche -rgb /usr/lib/X11/rgb.txt >porsche.xpm This results in a black&white xpm file that's easy to edit. I *really* did use emacs to add the color... :-) -- Mark Mark W. Snitily Consulting Services: 894 Brookgrove Lane Graphics, Operating Systems, Compilers Cupertino, CA 95014 (408) 252-0456 mark@zok.uucp West Coast UUCP X11 archive site If your mailer doesn't like the .uucp domain, these also work: ...!{mips,sgi}!zok!mark, mark%zok@mips.com, mark%zok@sgi.com