Does anybody have any advice for embedding png files using gtk? I used xxd to convert all the .png images into .h files, but I can't get them to show up right with gdk_pixbuf_new_from_data.
Does anybody have any advice for embedding png files using gtk? I used xxd to convert all the .png images into .h files, but I can't get them to show up right with gdk_pixbuf_new_from_data.
GdkPixbuf.Pixbuf.new_from_bytes
You need to filter your png files through say imagemagik to get just the raw RGB data.Currently only RGB images with 8 bits per sample are supported.
A close example:
imagemagick convert png 16 bit to raw - Stack Overflow
If you want GTK to handle all the PNG headers and compression, you need to use say new_from_file
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.