NiGui icon indicating copy to clipboard operation
NiGui copied to clipboard

Loading Images/Icons etc

Open wwderw opened this issue 1 year ago • 3 comments

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?

wwderw avatar Aug 01 '22 12:08 wwderw

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().

simonkrauter avatar Aug 01 '22 19:08 simonkrauter

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.

wwderw avatar Aug 03 '22 15:08 wwderw

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?

saemideluxe avatar Nov 02 '22 14:11 saemideluxe