Sneak this patch at night, while Mike and Rachel are sleeping and not particularly watching the cvs list

svn path=/trunk/gtk-sharp/; revision=7556
This commit is contained in:
Miguel de Icaza 2002-09-17 05:29:54 +00:00
parent f058a1b5f8
commit 2bff4ae70d

29
gdk/Pixbuf.custom Normal file
View File

@ -0,0 +1,29 @@
IntPtr LoadFromStream (System.IO.Stream input)
{
PixbufLoader loader = new PixbufLoader ();
byte [] buffer = new byte [8192];
int n;
while ((n = input.Read (buffer, 0, 8192)) != 0)
loader.Write (buffer, (uint) n);
loader.Close ();
return loader.Pixbuf.Handle;
}
public Pixbuf (System.IO.Stream input)
{
Raw = LoadFromStream (input);
}
public Pixbuf (System.Reflection.Assembly assembly, string resource)
{
if (assembly == null)
assembly = System.Reflection.Assembly.GetCallingAssembly ();
System.IO.Stream s;
Pixbuf p = null;
using (s = assembly.GetManifestResourceStream (resource))
Raw = LoadFromStream (s);
}