[Gtk-sharp-list] Gdk.Pixbuf

Parrish M Myers parrishmyers@yahoo.com
Sun, 18 May 2003 17:27:58 -0700 (PDT)


--- McP <mariano.cano@hispalinux.es> wrote:
> > Pixbuf pixbuf = new Pixbuf ("lcd.png");
> > CanvasPixbuf item = new CanvasPixbuf(lcd_canvas.Root());
> > item.Pixbuf = pixbuf;
> > 
> > This works great... but I have to include the png file in the
> current
> > directory when running the app.  If I try to include the file in
> the
> > resource string when compiling, i.e.
> > 
> > mcs ... -resource:lcd.png ...
> > 
> 
> Try
> Pixbuf pixbuf = new Pixbuf(null, "lcd.png");
> ....
> 
> Now you could store the file inside the assembly as a resource

That seems to produce this error when the resultant exe is created.. 
Am I including the resource improperly?  I added 
-resource:lcd.png 
to the 'mcs' command...
 
Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required
in <0x00090> 00 Gdk.Pixbuf:LoadFromStream (System.IO.Stream)
in <0x000aa> 00 Gdk.Pixbuf:.ctor (System.Reflection.Assembly,string)
in <0x000fe> 00 SwTimer.MainWindow:.ctor (ModeType)
in <0x00198> 00 SwTimer.SwTimer:.ctor (string[],object[])
in <0x00042> 00 SwTimer.SwTimer:Main (string[])


=====
-----------------------------------------------------------
Academia is a little like child   | Parrish M. Myers
rearing, it provides a chance at  | The Wacked Jester
immortality without the stretch   | parrishmyers@yahoo.com
marks  -- (unknown source)        |
-----------------------------------------------------------