Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!umd5!jonnyg From: jonnyg@umd5.umd.edu (Jon Greenblatt) Newsgroups: comp.windows.x Subject: Re: Drawing lines in windows with bitmaps Message-ID: <4846@umd5.umd.edu> Date: 5 May 89 16:29:28 GMT References: <8905022004.AA09962@sae.com> <6910007@hpfcdc.HP.COM> Reply-To: jonnyg@umd5.umd.edu (Jon Greenblatt) Organization: University of Maryland, College Park Lines: 25 In article <6910007@hpfcdc.HP.COM> stroyan@hpfcdc.HP.COM (Mike Stroyan) writes: >If you need more line colors than you can allocate planes for, you could >erase lines in front of a background pixmap by drawing the lines using a >GC which has a 'fill_style' value of 'FillTiled' and a 'tile' value of >the background pixmap. That should set the pixels in the line to the >background pixmap values. Of course, the performance may be terrible. > >Mike Stroyan, stroyan@hpfcla.hp.com Here is what I do: Pixmap pix; pix = XCreateBitmapFromData(Dpy,Wnd, dither_map_bits,dither_map_width,dither_map_height); XSetTile(Dpy,gc,pix); XFreePixmap(Dpy,pix); XSetFillStyle(Dpy,gc,FillTiled); Now anything including lines and filled things will use dither_map to draw on the screen. There is a command to set the tiling origin, make sure that is correct, the default should work fine. BTW the performance seems to be OK. JonnyG.