how to zoom a pixmap containing symbols



Hi,

I'm trying to zoom a pixmap. The pixmap contains a 8 bits image greyscale and a
lot of symboles or text strings. I want to zoom the image, the symbols and the
text strings.

for the construction of the image I do:

        guchar     *image_data;
        GdkRgbCmap *cmap;

        gdk_draw_indexed_image(pixmap,
                     gc, x, y, npix_x, npix_y, dith,
                     image_data,
                     rowstride, cmap);
        gdk_draw_text(pixmap,
                     font, gc, x, y, msg ,strlen(msg));
        gdk_draw_point(pixmap,
                     gc, x, y);
        ...

The display is made with

        gdk_draw_pixmap(image_drawing_area->window,
                     gc,
                     image_pixmap,
                     0, 0, 0, 0, npix_x, npix_y);

At this point, all is perfect, I have my own 'cmap' and all works very well.

But for the zoom, I get a part of the pixmap in a GdkImage with:

        GdkImage *image; 
        image = gdk_image_get(pixmap,
                        x_zoom_start,
                        y_zoom_start,
                        xsize, ysize);

and after, I get each pixel of the GdkImage with:

        guint32 pixel;
        pixel = gdk_image_get_pixel(image, i, j);

And now the problem is:

        What can I do with this pixel (guint32), it contains the good
        RGB information (it seems), but if I zoom it with:

        gdk_draw_rectangle(zoom_pixmap,
                                gc,
                                TRUE,
                                iz,
                                jz,
                                zoom_fact,
                                zoom_fact);

        what shall I put in the gc foreground value to obtain then same
        color I had in the original display (with my 'cmap')?


The aim of this program is to display CCD image, or FITS files (both in grey
values) in false color. I have a lot of cmap and I want to display the original
image with different cut levels, with different cmap, put symbols on the image
and finaly zoom part of the image situated under the mouse pointer.

This program acts also like a server and receive commands from socket. The last
problem was: how to zoom the image and visualize the symboles drawn on the
image.

Thanks a lot if you have a answer. May be I'm complety on a wrong way, but it's
really the only last problem.....

Luc Weber
Geneva Observatory
Switzerland







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]