NiGui
NiGui copied to clipboard
Loading Images/Icons etc
Is there anyway to load from a byte seq for images etc? I'm wanting to bundling in the assets and instead of doing writing and removing from where I want to have those assets all the time, I was wondering if it's possible to load from in-memory buffer?
This is currently not implemented, but would be possible, I think. On Gtk it would use gdk_pixbuf_new_from_stream() instead of gdk_pixbuf_new_from_file(). On Windows it would use GdipCreateBitmapFromStream() instead of GdipCreateBitmapFromFile().
Bitmap from stream may be easier. Probably could use staticRead() to bundle it in this case and just take make that a newStringStream() and load it that way. Keep my libs down I'm thinking.
It would be really nice to either have image creation from memory or a way to access the native surface data. I would like to implement a small simulation-app which needs to read and write pixel data directly. As far as I can see there is absolutely no way to efficiently work with pixel-data. The only way currently seems to be to call setPixel for every single pixel, right?