|
|
1.1 root 1: #include "jerq.h"
2:
3: /*
4: * Read back the value of a pixel
5: */
6: getpoint(b,p)
7: Bitmap *b;
8: Point p;
9: {
10: int bit;
11: #ifdef X11
12: XImage *im;
13:
14: if(b->flag & BI_OFFSCREEN)
15: p = sub(p, b->rect.origin);
16: im = XGetImage(dpy, b->dr, p.x, p.y, 1, 1, 1, XYPixmap);
17: bit = (*im->data != 0);
18: XDestroyImage(im);
19: #endif X11
20: #ifdef SUNTOOLS
21: if(b->flag & BI_OFFSCREEN) {
22: p = sub(p, b->rect.origin);
23: bit = (pr_get((Pixrect *)b->dr, p.x, p.y) != 0);
24: } else
25: bit = (pw_get((Pixwin *)b->dr, p.x, p.y) != 0);
26: #endif SUNTOOLS
27: return (bit);
28: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.