[Gtk-sharp-list] Marshaling a byte[] for a pixbuf

MDK mdk at mdk.org.pl
Fri Jul 15 18:26:15 EDT 2005


Dnia 13-07-2005, śro o godzinie 11:13 -0400, Miguel de Icaza napisał(a):

> You could create the Pixbuf on the unmanaged side, and use the raw
> constructor: 'Pixbuf (IntPtr raw)'

Yes, that works nicely. When creating the pixbuf at the unmanaged, I
specify a pointer to the (unmanaged) function as the pixbuf's
destroy-notification. That function contains a simple g_free on the
previously allocated memory. When the pixbuf is garbage-collected on the
managed side, this function gets called nicely (though, I don't really
know _WHO_ calls it)

BTW, I'm not using pixbufs to pass the actual playback data (that would
be a performance overkill). I'm merely using them to generate all kinds
of thumbnails & frame previews. When playing, I'm drawing directly to
the XOverlay so I don't need to handle the data on the managed. 


-- 
Michał Dominik K.
mdk at mdk.org.pl
www.mdk.org.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20050716/e067ad6d/attachment.bin


More information about the Gtk-sharp-list mailing list