Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading Images/Icons etc #154

Open
wwderw opened this issue Aug 1, 2022 · 3 comments
Open

Loading Images/Icons etc #154

wwderw opened this issue Aug 1, 2022 · 3 comments
Labels

Comments

@wwderw
Copy link

wwderw commented Aug 1, 2022

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?

@simonkrauter
Copy link
Owner

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

@wwderw
Copy link
Author

wwderw commented Aug 3, 2022

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.

@saemideluxe
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants