Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!spool.mu.edu!cs.umn.edu!kksys!pwcs!com50!pai!erc From: erc@pai.UUCP (Eric F. Johnson) Newsgroups: comp.windows.x Subject: Re: How do you draw a bitmap into a window? Keywords: XCopyPlane() Bitmaps to windows Message-ID: <1757@pai.UUCP> Date: 8 May 91 22:39:04 GMT Organization: Boulware Technologies, Inc., Burnsville, MN Lines: 38 >This may be a stupid question, but what is the magic to putting a bitmap >into a window? I made a window with XCreateSimpleWindow, used >XCreateBitmapFromData to make the bitmap, and then realized I have *no* >idea where to go from here! >Mike Hoffos (mikeh@fsd.cpsc.ucalgary.ca) In X jargon... You want to copy the contents of one drawable (your bitmap) to another drawable (your window). Bitmaps are really single-plane pixmaps, by the way. So, look up XCopyPlane(): XCopyPlane( display, src_drawable, dest_drawable, gc, src_x, src_y, width, height, dest_x, dest_y, bitplane ) Where src_drawable is your bitmap dest_drawable is your window src_x, src_y are 0,0 (assuming you want to draw the entire bitmap) width, height are the size of your bitmap (ditto) dest_x, dest_y is where you want the bitmap to appear in the window bitplane is 0x01 since bitmaps are really pixmaps that have ONE bitplane (they are one-bit deep). For more information on this, look up pages 312-314 in _X Window Applications Programming_ (1989, MIS: Press, ISBN 1-55828-016-2). Hope this helps, -Eric -- Eric F. Johnson phone: +1 612 894 0313 BTI: Industrial Boulware Technologies, Inc. fax: +1 612 894 0316 automation systems 415 W. Travelers Trail email: erc@pai.mn.org and services Burnsville, MN 55337 USA