Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!widener!netnews.upenn.edu!msuinfo!chassel.cps.msu.edu!courtney From: courtney@chassel.cps.msu.edu (Jonathan Courtney) Newsgroups: comp.windows.open-look Subject: server images Message-ID: <1991Apr3.173428.27898@msuinfo.cl.msu.edu> Date: 3 Apr 91 17:34:28 GMT Sender: news@msuinfo.cl.msu.edu Reply-To: courtney@chassel.cps.msu.edu (Jonathan Courtney) Organization: PRIP Lab, Comp. Sci. Dept., MSU Lines: 48 Recently I posted a request for help with XView colormap segments. As it turned out, the problem was not one with my colormap segment, but with the server image that I was using to test it. Which led me to an entirely different dilemma: I am creating an xview server image that should be a simple gray ramp with values from 0-255. Yet when I display the image, only colors from 0-127 are displayed. It turns out that the xv_create call actually zeroes out the data with values >= 128. It sounds to me like a sign problem, but the same data works with XCreateImage calls just fine. Any thoughts? ========== #include Server_image image; char* buffer; int i, j; ... buffer = (char*)malloc(256*256); /* Make the gray ramp */ for (i=0; i<256; i++) for (j=0; j<256; j++) buffer[i*256+j] = j; /* Create the image in "X" format */ image = xv_create(NULL, SERVER_IMAGE, XV_WIDTH, 256, XV_HEIGHT, 256, SERVER_IMAGE_DEPTH, 8, SERVER_IMAGE_X_BITS, buffer, SERVER_IMAGE_COLORMAP, "my_colormap", NULL); ============== And then I use the image in a PANEL_LIST object. Again, any help is greatly appreciated. Jon