[Gtk-sharp-list] Current way of creating a Pixbuf from an RGB Array

Christian Hoff christian_hoff at gmx.net
Fri Aug 8 05:13:18 EDT 2008

You will probably have to update your mono installation or use SVN. As 
Zolton Varga stated in the bug, this has been fixed in February. I have 
tested it out(using Gtk# and Mono SVN versions) and it works fine :-)

> Hello,
> can someone please tell me what's the current way of getting a Gdk.Pixbuf
> from an byte[] full of RGB Values? I know that there is an overload of the
> Gdk.Pixbuf constructor which would normally accomplish this, but according
> to my tests and Bug ID 362951 it seems to be broken in 2.0 Preview.
> I use the following statement:
> Gdk.Pixbuf picture = new Gdk.Pixbuf( m_RawData, Gdk.Colorspace.Rgb, false,
> 8, m_RawResolution.Width, m_RawResolution.Height, m_RawResolution.Width * 3,
> null );
> and get the following exception:
> Unhandled Exception: System.InvalidProgramException: Invalid IL code in
> (wrapper
>  native-to-managed) GdkSharp.PixbufDestroyNotifyWrapper:NativeCallback
> (intptr,i
> ntptr): IL_0030: call      0x00000006
> Any ideas?
> Thanks,
> Egon

More information about the Gtk-sharp-list mailing list