home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!utcsri!newsflash.concordia.ca!sifon!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Subject: Re: Copying pixmaps
- Message-ID: <1992Nov10.061048.4911@thunder.mcrcim.mcgill.edu>
- Organization: McGill Research Centre for Intelligent Machines
- References: <1992Nov7.142620.23268@alf.uib.no>
- Date: Tue, 10 Nov 92 06:10:48 GMT
- Lines: 26
-
- In article <1992Nov7.142620.23268@alf.uib.no>, singg@alf.uib.no (Kurt George Gjerde) writes:
-
- > I use the following code to copy a pixmap to another pixmap:
-
- > image = XGetImage(dpy, pixmap, 0,0, width,
- > height, 1, XYPixmap);
-
- > XPutImage(dpy,pixmap2, gc, image, 0,0,0,0,
- > image->width, image->height);
-
- > XFree(image);
-
- > Are there any faster ways of doing this??
-
- Almost certainly. If the pixmaps are the same depth, XCopyArea is
- almost certain to be far faster, especially since XYPixmap is usually
- not the "native" format and thus has to be converted to and from, which
- will cost.
-
- Besides that, XFree is not the right thing to use to free up the XImage
- returned by XGetImage. You should use XDestroyImage.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-