[Mono-list] problem with embedded PNG resources

Miguel de Icaza miguel@ximian.com
Fri, 11 Feb 2005 17:39:55 -0500


Hey,

> arturo@ubuntuserver:~/programacion/mono/MORCILIA $ mono morcilia.exe
>=20
> Unhandled Exception: GLib.GException: No se ha podido abrir el archivo
> =ABimages/logo_ilias.png=BB: No existe el fichero o el directorio
> in <0x000a4> Gdk.Pixbuf:.ctor (string)
> in <0x000a4> MORCILIA.DruidInstaller:.ctor (string[])
> in <0x00020> MORCILIA.GtkMorcilia:Main (string[])
>=20
> Why is it keeping path information? I want the png embedded, not
> referencing any path...
>=20
> I can't understand why it happens. I'm calling Gdk.Pixbuf like:
>=20
> logo =3D new Gdk.Pixbuf("images/logo_ilias.png");
>=20
> but i tried logo =3D new Gdk.Pixbuf(null,"images/logo_ilias.png"), as i
> saw it in Edd Dumbill excelent book, but don't know its effect, it also
> fails on execution time. This method isn't still documented in monodoc.

The constructor you are using expects a file name;  you must use the
constructor that takes an assembly and a resource name:

	pixbuf =3D new Gdk.Pixbuf (assembly, "logo_ilias.png");