int g_rgb_read(Engine *eng, GpColor *rgb, long *nx, long *ny) { XEngine *xeng = GisXEngine(eng); if (!xeng || !xeng->w || !xeng->win) return 1; GpPreempt(eng); GdDraw(1); /* make sure screen updated */ GpPreempt(0); if (xeng->w == xeng->win) { /* not in animate mode */ if (!rgb) { *nx = xeng->wtop; *ny = xeng->htop; } else { p_rgb_read(xeng->win, rgb, xeng->leftMargin, xeng->topMargin, xeng->leftMargin+xeng->wtop, xeng->topMargin+xeng->htop); } } else { /* in animate mode, read offscreen pixmap */ if (!rgb) { *nx = xeng->a_width; *ny = xeng->a_height; } else { p_rgb_read(xeng->w, rgb, 0, 0, xeng->a_width, xeng->a_height); } } return 0; }
int g_rgb_read(Engine *eng, GpColor *rgb, long *nx, long *ny) { XEngine *xeng = GisXEngine(eng); if (!xeng || !xeng->w || !xeng->win) return 1; if (!rgb) { *nx = xeng->wtop; *ny = xeng->htop; } else { p_rgb_read(xeng->win, rgb, xeng->leftMargin, xeng->topMargin, xeng->leftMargin+xeng->wtop, xeng->topMargin+xeng->htop); } return 0; }