[comp.windows.x] problem w/ Sun X

richk@uw-june.UUCP (Richard Korry) (07/21/87)

I have a problem with our Sun implementation of X windows. The following code
segment works fine on microVaxen, IBM RTs, and color Sun 110s but fails on
monochrome Sun 140s. The problem is with XPixmapBitsPutXY() - it simply doesn't
work. The XPixmapGetXY() works fine, I can write it out to a file, but trying
to diplay it elsewhere in the window doesn't work at all.
If anyone knows what the problem could be, please send me e-mail... thanks
    rich
-------------------------
    /* decide if we are monochrome, or color */
    if (DisplayPlanes() == 1)
        size = XYPixmapSize(width, height, 1);
    else if (DisplayPlanes() > 8)
        size = WZPixmapSize(width, height);
    else
        size = BZPixmapSize(width, height);

    /* get memory space and grab pixels */
    Raster = (char*)calloc(size, 1);
    if (DisplayPlanes() == 1)
        XPixmapGetXY(window, here->x, here->y, width, height, Raster);
    else
        XPixmapGetZ(window, here->x, here->y, width, height, Raster);

    /* display it elsewhere in the window */
    if (DisplayPlanes() == 1)
        XPixmapBitsPutXY(window, there->x, there->y, width, height, 
                         Raster, 0, 1, AllPlanes);
    else
        XPixmapBitsPutZ(window, there->x, there->y, width, height, 
                        Raster, 0, 1, AllPlanes);