mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-11 18:45:32 +00:00
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:
parent
f058a1b5f8
commit
2bff4ae70d
29
gdk/Pixbuf.custom
Normal file
29
gdk/Pixbuf.custom
Normal 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);
|
||||||
|
}
|
Loading…
Reference in a new issue