Re: HICON to GdkPixbuf
Tor Lillqvist a écrit : Does anyone have ideas about how to convert such an HICON to a GdkPixbuf? There is code in gdk/win32 to do that, check the function gdk_win32_icon_to_pixbuf_libgtk_only() in gdk/win32/gdkcursor-win32.c in GTK+. This is an internal function so you aren't supposed to call it. But as it is in libgdk, and is called by libgtk, it is in fact exported, so you *can* call it. Include gdk/gdkwin32.h for the prototype. Thanks, that worked. Actually, I guess one could argue this is a useful function that should exist as a public (even if platform-specific) API, in libgdk-pixbuf. Indeed! There's a whole serious image decoder in there, would even be nice if it were in its own library :) Andrew ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
HICON to GdkPixbuf
Hi I want to load some icons from .dll files on windows and what the win32 API gives me is an HICON. Does anyone have ideas about how to convert such an HICON to a GdkPixbuf? Thanks in advance, Andrew ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: HICON to GdkPixbuf
Does anyone have ideas about how to convert such an HICON to a GdkPixbuf? There is code in gdk/win32 to do that, check the function gdk_win32_icon_to_pixbuf_libgtk_only() in gdk/win32/gdkcursor-win32.c in GTK+. This is an internal function so you aren't supposed to call it. But as it is in libgdk, and is called by libgtk, it is in fact exported, so you *can* call it. Include gdk/gdkwin32.h for the prototype. As it is an internal function, its API could change at any time, and the function could disappear even. (Although I don't see any immediate reason why its protype would change or it would disappear.) If the LGPL license of the GTK+ code is compatible with your application's license it probably is a better idea to just lift the code into your application. Actually, I guess one could argue this is a useful function that should exist as a public (even if platform-specific) API, in libgdk-pixbuf. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list