Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!think.com!linus!linus!mir!dsr From: dsr@mir.mitre.org (Douglas S. Rand) Newsgroups: comp.windows.x Subject: Re: Draw color image Message-ID: <1991Feb4.172202.27154@linus.mitre.org> Date: 4 Feb 91 17:22:02 GMT References: <1991Feb2.000128.5464@efi.com> Sender: news@linus.mitre.org (News Service) Reply-To: dsr@mir.mitre.org (Douglas S. Rand) Organization: The MITRE Corporation Lines: 37 Nntp-Posting-Host: mir.mitre.org In article <1991Feb2.000128.5464@efi.com>, chiu@efi.com (Chan Chiu) writes: > I am programming to display color image in X window (256 colors). > > It looks like XDrawPointer doesn't support color (It doesn't have a parameter > to input color value). > Wrong. The GC in XDrawPoint or XDrawPoints allows you to specify the foreground color. However this is an inefficient way to deal with images. > I am aware of only two ways : (Correct me if I'm wrong) > > 1, I use pixmap. Then I use XCopyArea. > The trick here is that I cannot find any routine to modifies pixmap > data. You can use pixmaps to buffer the image. All the XDraw** routines take a drawable which is defined as either a window or a pixmap. So... > 2, I use XImage. Then XPutImage to window. > Use XPutImage to put the image to a pixmap and make that pixmap the background pixmap of your display window. Works great. > Any pointers ? > > /Chan O'Reilly books vI and vII have it all. There are doubtlessly other places as well. -- Douglas S. Rand Internet: Snail: MITRE, Burlington Road, Bedford, MA Disclaimer: MITRE might agree with me - then again... Amateur Radio: KC1KJ