C�sar Leonardo Blum Silveira wrote:
Yep! Thanks :-)
But still I need some help.
1) how do I set my values to 8 bit? In C I used guint8
2) What is bits per sample?
Now you're outside python and pygtk realms :)...
I have never used those, neither that function, nor the Numeric
extension for python... so I'd expect some utility functions in there.
Apart from this, you can always use bitwise operators to pack whatever
values you want. The bits per sample thing means, as far as I can
understand, the number of bits each color sample uses to represent its
value, but you could try in #gtk or search in google for it.
Anyway... you should read the whole reference page (gtk.gdk.Pixbuf) and
I bet it would be of some help reading the C reference
(http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html).
It explains the inner workings in broader detail. Searching for similar
entries in google gives me too:
-
http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-data
-
http://www-eleves-isia.cma.fr/documentation/GtkDoc/gdk-pixbuf/gdk-pixbuf-creating.html
(saying that only 8bits per sample is currently supported. An older
version of the previous document, but from that commentary I understand
that bits per sample is bits per color/alpha value).
- And here you have a working example in C, (with a quite
straightforward python translation), explaining how values are packed
using bitwise operators and the whole workflow :)
http://www.gnome.org/~mathieu/libart/sample.html
Good luck,
Pachi
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/