Drawing images - recent addition. Is it possible to use an existing, local image as well? #117
Replies: 1 comment 1 reply
|
Hi Thank you for trying out the new pre-release. Of course, it can display image files as well. All you need to do is use a library to convert the image into a matrix, and there are plenty of ways to do that. There are various libraries available, ranging from those implemented in Ruby to C extensions. As you already know. I’m reluctant to add new features right now. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey there kojix2,
I just tested the --pre variant of libui and your example at:
https://raw.githubusercontent.com/kojix2/LibUI/refs/heads/main/examples/area_draw_image.rb
works fine, drawing striped rainbow-like patterns.
I understand, I think, the code in that sample_rgba() provides the R, G, B colours
and:
will do the actual drawing.
My question here is: is it possible to paint a regular image that way as well, perhaps
via some conversion? For instance, I use https://github.com/hzeller/timg to show
images on the terminal (KDE konsole). If the new functionality in ruby-LibUI allows
for images to be drawn, if the RGB values are known at each individual point,
perhaps we can already draw existing images, even if only simple images. That may
also help having more UI elements that could be put into a libui application.
Edit: I realised this is more a question or a discussion, than an issue request, so I
transferred it.
All reactions