Re: Creating GdkPixbuf from PNG data
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Tristan Van Berkom <tristan van berkom gmail com>
- Cc: Pramod Patangay <pramod_iitg yahoo com>, gtk-list gnome org
- Subject: Re: Creating GdkPixbuf from PNG data
- Date: Fri, 7 Jan 2005 16:38:25 +0100
On Fri, Jan 07, 2005 at 09:44:59AM -0500, Tristan Van Berkom wrote:
> >
> > I have PNG data in memory which is essentially the
> > contents of a png file. I need to create a GdkPixbuf
> > from this data. How can I do this?
>
> Hmmm, GdkPixbuf API docs have a section on this:
> http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-creating.html
>
> I think you can use `gdk_pixbuf_new_from_inline ()' and GdkPixbuf
> will parse the image header and figure out the image encoding type
> by itself :-)
I don't think so. This function creates a pixbuf from
a `serialized' GdkPixbuf, created by gdk-pixbuf-csource.
I would probably dump the data to a PNG file and use
gdk_pixbuf_load(). That's not optimal, but if it's not
a something the app needs to do often... Another question
is how did you get the `essentially the contents of a png
file'? It may be easier to create a pixbuf from some
original data...
Yeti
--
Dynamic IP address is not a crime.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]