Re: Display grayscale image
- From: jcupitt gmail com
- To: "Jim George" <jimgeorge gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Display grayscale image
- Date: Fri, 31 Aug 2007 09:00:40 +0100
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]