Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!snowking.ebay.sun.COM!tomj From: tomj@snowking.ebay.sun.COM (Tom Jacobs) Newsgroups: comp.windows.x Subject: Re: X11 and PIXRECTS Message-ID: <8910231837.AA14833@snowking.sun.com> Date: 23 Oct 89 18:37:46 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 56 Andrew MacLean writes: > I have heard that in order to use memory pixrects with X11/NeWS, I MUST use > the PIXWIN interface "as a compatibility veneer over Xlib." Not necessarily true, remember Pixwin is just a windowing interface to using Pixrects and Pixrects are just a client-side representation of data. XView has reimplemented the Pixwin interface by translating the Pixwin calls to Xlib calls. However, not all of the logic of Pixrect/Pixwin translates well in the Xlib graphics. This is because the PIX_* graphics OPS made assumptions about foreground and background colors. The result is that pixwin (not pixrect) calls may work on one server, but not on another. > Is this true? Is there no way to use X windows to display a memory pixrect > into? No, you can do the translation of the mpr to a Pixmap by calling XCreateImage(). Below is what XView does to create a simple bitmap from a mpr... xv_image_1(dest_info) = r_ximage = (XImage *) XCreateImage(display, visual, 1, XYBitmap, 0, (char *) mpr_d(((Pixrect *) src))->md_image, 0, 0, MPR_LINEBITPAD, mpr_d(((Pixrect *) src))->md_linebytes); The above is from the XView source (usr.lib/libxvin/pw/xv_rop.c). ... ... > The problem that I have run into is that if I take an image contained in a > memory pixrect, and use the pr_rop routine to display the image to the screen > (while running X11/NeWS) the system crashes. (The system is a SPARC Station 1) Under XView, we first create the Pixmap and then copy that into the window. > Is there some kind of preparation of the screen that I should perform before > displaying the pixrect image? (for example, locking the screen?) Is it > possible to avoid using the PIXWIN interface? Does anyone have any similar > code that they have written that I may use as an example?` Get the XView source and look at our Pixwin compatibility code (usr.lib/libxvin/pw) > Any information would be greatly appreciated. > > Signed Frustrated!!! > > Thankyou, in advance. > -- > Andrew MacLean ...uunet!mnetor!lsuc!isgtec!andrew > Success is a journey, not an adventure! ...utzoo!lsuc!isgtec!andrew > ISG Technologies Inc. 3030 Orlando Dr. Mississauga. Ont. Can. L4V 1S8 Tom Jacobs (tomj@sun.com -or- ..!sun!tomj) Sun Microsystems, Inc. Mountain View, CA 94043