Skip to content

Drawing images - recent addition. Is it possible to use an existing, local image as well? #116

Description

@rubyFeedback

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:

LibUI.image_append(image, pixels, width, height, width * 4)

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions