Added Image::setImageFromMemory and Image::setImageFromRawData - #162
Added Image::setImageFromMemory and Image::setImageFromRawData#162iUltimateLP wants to merge 10 commits into
Conversation
|
Hi, thanks for the PR! This is a duplicate of #159 but I can merge whichever PR is finished first. Do you think you could add a way to test / showcase this in the demo? |
|
Ah didn't see the other PR :) As for a demo case, I'd implement a new view element "DynamicImage" or something which generates a random Bitmap and renders that! |
|
Had some nasty bugs with memory allocation, which is why I switched from |
… the first still might be useful for e.g. image files requested from the web
|
This is absolutely not the same, and if I were to choose I would keep the "from mem" instead of "from RGBA" method. The "from mem" method is used to load JPG / PNG files from memory, and is actually currently used in the sys-clk manager to display game thumbnails. Any homebrew dealing with images on HOS would need it too (homebrew menu, qlaunch replacement, album replacement...). I understand that it's hard to generate a random PNG in memory, so how about adding both methods and only making an example for thr RGBA one ? |
|
See my latest commit, I had the same thought :P |
…n for demo, made label using i18n, included in meson.build
|
This is great! I feel like the example image is a little bit too big and too close to the other images (it's missing some padding). Could you maybe make it a rectangle, like the "stretched" image example? And add some top padding. Thanks! |
|
Sure, here you go :) |
|
Any update @natinusala? :) |
EmmmaTech
left a comment
There was a problem hiding this comment.
Since natinusala is busy, I decided to look at this PR myself. Here is one change you should consider making
…ut doesn't alter the data, so we don't have to expose the non-constness to borealis
Adds support to set the image resource a brls::Image view shows from memory using nanovg's nvgCreateImageMem.