[Gtk-sharp-list] resource file

Fredrik Nilsson jymdman@home.se
Fri, 30 Jul 2004 15:00:12 +0200


On fre, 2004-07-30 at 13:07 +0000, wrote:
> I had icons to my toolbar and i would like include all image in a ressource file.
> 
> So i create the resource file and add my picture.
> But how can i acces my picture.
> 
> I have done this, it does compile but i receved empty value.
> 
> In the My windows Class:
> ResourceManager rm;
> 
> In public MyWindow ():
> rm = new ResourceManager(typeof(MyWindow));
> 
> then to acces data:
> (string) rm.GetObject("xbgm.png"));
> 
> This compile but doesn't work.
> 
> Can anyone help me please?
> Thanks for advaced.
> 
> Kaya
> 

Hi,

You can use Gdk.Pixbuf to load the image from a resource file.

Just use:

Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (null, "xbgm.png");

Add the image to Resource Files in monodevelop.

/Fredrik