Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!shodha.dec.com!gsrc.dec.com!west From: west@gsrc.dec.com (Jim West (Stealth Contractor)) Newsgroups: comp.windows.x Subject: Re: How to copy from depth 1 to depth n Message-ID: <1472@shodha.dec.com> Date: 25 Jul 90 15:26:22 GMT Sender: news@shodha.dec.com Organization: Digital Equipment Corporation Lines: 60 In article <114409@linus.mitre.org>, dsr@luke.mitre.org (Douglas S. Rand) writes... >I'm a little stuck. I can create a pixmap from a bitmap file >with XReadBitmapData. Great. Now what do I do to create >a pixmap with the same depth as my display but with the same >bitmap data? What I don't want to do (and the only alternative I >see) is to do a XGetImage and XGetPixel along with a separate >XCreatePixmap (right depth). Will someone please tell me >I'm wrong (but be right about it OK? :) . > >Douglas S. Rand >Internet: >Snail: MITRE, Burlington Road, Bedford, MA >Disclaimer: MITRE might agree with me - then again... >Amateur Radio: KC1KJ The following code bits are in Ada but I think you'll get the idea. x.read_bitmap_file ( status => status, display => display, drawable_id => root, file_name => file_name (1 .. file_name_len), width_return => width, height_return => height, bitmap_id_return => bitmap_id, x_hot_coord_return => hot_x, y_hot_coord_return => hot_y); x.create_pixmap ( result => pixmap_id, display => display, drawable_id => root, width => width, height => height, depth => depth); -- default depth of screen x.copy_plane ( display => display, src_drawable_id => bitmap_id, dst_drawable_id => pixmap_id, gc_id => gc, src_x_coord => 0, src_y_coord => 0, width => width, height => height, dst_x_coord => 0, dst_y_coord => 0, plane => 1); -- Here is where the magic is ---------------------------------------------------------------------- Jim West | The Schainker Converse west@gsrc.dec.com | to Hoare's Law : | These are my opinions. | Inside every small problem Digital has no idea | is a larger problem struggling what I'm saying. | to get out. ----------------------------------------------------------------------