Re: Display grayscale image



On 8/31/07, Jim George <jimgeorge gmail com> wrote:
On 8/30/07, Marco Brambilla <m brambilla polimi it> wrote:
Is there a easy way of displaying such an image "as is" (single channel) ? Or must I convert it each 
pixel to
the a RGB triplet needed by gtk_pixbuf_new_from_data ?

You could possibly use gdk_image, but it's easier to use a pixbuf and
just copy the grayscale value thrice into R, G and B. Remember to use

Another option (though a little harder) is to make a GtkDrawingArea,
connect to the "expose" signal, and use gdk_draw_gray_image() to paint
the damaged area from your stored 1-channel image. It ought to be
quite a bit faster.

John



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