home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!alf.uib.no!alf.uib.no!singg
- From: singg@alf.uib.no (Kurt George Gjerde)
- Subject: Load pixmap into pixmap
- Message-ID: <1992Nov7.142104.23123@alf.uib.no>
- Sender: usenet@alf.uib.no (Bergen University Newsaccount)
- Organization: University of Bergen, Norway
- Date: Sat, 7 Nov 92 14:21:04 GMT
- Lines: 31
-
- I use the following code for loading a pixmap and drawing it inside
- another pixmap:
-
- userpixmap = XmGetPixmap(XtScreen(drawing_a),name,fg,bg);
-
- if (userpixmap==XmUNSPECIFIED_PIXMAP)
- reportError(drawing_a,"Can't find bitmap '%s'.",name,NULL,
- NULL,NULL);
- else {
-
- if (XGetGeometry(dpy,userpixmap, &d_root, &d_x, &d_y, &width,
- &height, &d_border_width, &d_depth)) {
-
- image = XGetImage(dpy, userpixmap, 0,0, width, height,
- 1, XYPixmap);
-
- XPutImage(dpy,win, gc,image,0,0,posX,
- posY,image->width, image->height);
- XPutImage(dpy,pixmap, gc,image,0,0,posX,
- posY,image->width, image->height);
-
- XFree(image);
- }
- XmDestroyPixmap(XtScreen(drawing_a),userpixmap);
- }
-
- Are there any faster ways to do this??
-
-
- Kurt.
-
-