Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!natinst!brian From: brian@natinst.com (Brian H. Powell) Newsgroups: comp.windows.x Subject: Offscreen coordinate systems Message-ID: <21470@natinst.natinst.com> Date: 2 Apr 91 20:52:49 GMT Organization: National Instruments, Austin, TX Lines: 21 Our application has a single window, and it has several objects which draw at various locations on this window. (These objects are not themselves windows.) These objects know their bounds, and draw in the window's coordinate system. We'd like to have these objects draw into an offscreen pixmap. This is not as simple as it sounds, evidently. Pixmaps assume their origin is (0,0). Therefore, we must either allocate a pixmap as big as our window, and leave most of it unused, or we must inform these various objects that they're being drawn offscreen, and need to munge on the coordinates. The former is easy to do, but seems like a waste. E.g., if we need a 100x100 square in the lower right hand corner of a 1Kx1Kx32-bit window, we get to allocate (on the server) 4 megabytes, of which we use 40K. Yuck. The latter is also distasteful. It'd probably be easiest to have a coordinate translation that's done for every drawing command. You can't really change the objects' notion of where it is, because that'd screw up picking. (Or you could keep a separate rectangle: one for drawing, one for picking. Again, yuck.) How do others deal with this situation? Brian