Gdk::Pixbuf::create_from_data problem



Hi everyone,

I'm trying to create a Pixbuf from an array of pixels. The array size is width*height, with only one channel because it's a grayscale image.
I call create_from_data like this :

Gdk::Pixbuf::create_from_data(mp.getImg(i,j)->getSrc(), // guint8* array (1024*768)
				    Gdk::COLORSPACE_RGB,false,8,
				    mp.getImg(i,j)->getSizeX(), // 1024
				    mp.getImg(i,j)->getSizeY(), // 768
				    mp.getImg(i,j)->getSizeX()); // 1024

But when I save it to a file or display it I see my image repeated horizontally three times.

I guess it's a problem of channel number ?

How can I solve it ?

Thanks for your help,
Aurélien




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