Reputation: 477
in my program I want to use an image file without it being present on the local hard drive.
So, I used xxd -i
to generate an unsigned char[]
containing the image data and embedded this in my program.
But now I am stuck trying to load a Gdk::Pixbuf
(or a Gtk Image) from this, since I dont seem to find a function which could do that.
Upvotes: 2
Views: 943
Reputation: 400129
That sounds like a job for Gdk::Pixbuf::create_from_data
.
Note that an array like that is not a string, which might explain why you had problems finding this.
It's in the "Image Data in Memory" category which isn't that hidden, on the other hand.
EDIT2: Changed to the same function's gtkmm API wrapper, after comment.
Upvotes: 2