Sha256: 3a41c43f6c28d6108acd2de7b57c57abbe9bfe65fdb9637c23f4a6ac31bed953

Contents?: true

Size: 790 Bytes

Versions: 20

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

require 'glimmer-dsl-libui'

include Glimmer

window('Basic Image', 96, 96) {
  area {
    # image is not a real LibUI control. It is built in Glimmer as a custom control that renders
    # tiny pixels/lines as rectangle paths. As such, it does not have good performance, but can
    # be used in exceptional circumstances where an image control is really needed.
    #
    # Furthermore, adding image directly under area is even slower due to taking up more memory for every
    # image pixel rendered. Check basic_image2.rb for a faster alternative using on_draw manually.
    #
    # It is recommended to pass width/height args to shrink image and achieve faster performance.
    image(File.expand_path('../icons/glimmer.png', __dir__), 96, 96)
  }
}.show

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
glimmer-dsl-libui-0.4.13 examples/basic_image.rb
glimmer-dsl-libui-0.4.12 examples/basic_image.rb
glimmer-dsl-libui-0.4.11 examples/basic_image.rb
glimmer-dsl-libui-0.4.10 examples/basic_image.rb
glimmer-dsl-libui-0.4.9 examples/basic_image.rb
glimmer-dsl-libui-0.4.8 examples/basic_image.rb
glimmer-dsl-libui-0.4.7 examples/basic_image.rb
glimmer-dsl-libui-0.4.6 examples/basic_image.rb
glimmer-dsl-libui-0.4.5 examples/basic_image.rb
glimmer-dsl-libui-0.4.4 examples/basic_image.rb
glimmer-dsl-libui-0.4.3 examples/basic_image.rb
glimmer-dsl-libui-0.4.2 examples/basic_image.rb
glimmer-dsl-libui-0.4.1 examples/basic_image.rb
glimmer-dsl-libui-0.4.0 examples/basic_image.rb
glimmer-dsl-libui-0.3.5 examples/basic_image.rb
glimmer-dsl-libui-0.3.4 examples/basic_image.rb
glimmer-dsl-libui-0.3.3 examples/basic_image.rb
glimmer-dsl-libui-0.3.2 examples/basic_image.rb
glimmer-dsl-libui-0.3.1 examples/basic_image.rb
glimmer-dsl-libui-0.3.0 examples/basic_image.rb