Sha256: 6d929f9bea81ce6a39a1c28b9092893a2c3c8ab4d9739f33b9290ec68088a28f

Contents?: true

Size: 981 Bytes

Versions: 20

Compression:

Stored size: 981 Bytes

Contents

require 'fox16'
require 'RMagick'

include Fox

class RMagickExample < FXMainWindow

  def initialize(app)
    super(app, "RMagick Example", :width => 800, :height => 600)

    # Construct an ImageList
    dippy = Magick::ImageList.new(File.join("icons", "dippy.png"))

    # Manipulate the image
    text = Magick::Draw.new
    text.annotate(dippy, 0, 0, 0, 60, "Dippy Duck") do
      self.gravity = Magick::SouthGravity
      self.pointsize = 24
      self.stroke = 'transparent'
      self.fill = '#0000A9'
      self.font_weight = Magick::BoldWeight
    end

    # Extract image data and use it to construct FXPNGImage
    dippy_image = FXPNGImage.new(app, dippy.to_blob)

    # Display it inside an FXImageFrame
    FXImageFrame.new(self, dippy_image, :opts => LAYOUT_FILL)
  end

  def create
    super
    show(PLACEMENT_SCREEN)
  end

end

if __FILE__ == $0
  FXApp.new("RMagick Example", "FXRuby") do |app|
    RMagickExample.new(app)
    app.create
    app.run
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fxruby-1.6.28-x86-mingw32 examples/rmagick.rb
fxruby-1.6.28-x64-mingw32 examples/rmagick.rb
fxruby-1.6.28 examples/rmagick.rb
fxruby-1.6.27-x86-mingw32 examples/rmagick.rb
fxruby-1.6.27-x64-mingw32 examples/rmagick.rb
fxruby-1.6.27 examples/rmagick.rb
fxruby-1.6.26-x86-mingw32 examples/rmagick.rb
fxruby-1.6.26 examples/rmagick.rb
fxruby-1.6.26.pre1-x86-mingw32 examples/rmagick.rb
fxruby-1.6.26.pre1 examples/rmagick.rb
fxruby-1.6.25-x86-mingw32 examples/rmagick.rb
fxruby-1.6.25 examples/rmagick.rb
fxruby-1.6.25.pre2-x86-mingw32 examples/rmagick.rb
fxruby-1.6.25.pre2 examples/rmagick.rb
fxruby-1.6.25.pre1-x86-mingw32 examples/rmagick.rb
fxruby-1.6.25.pre1 examples/rmagick.rb
fxruby-1.6.24-x86-mingw32 examples/rmagick.rb
fxruby-1.6.24 examples/rmagick.rb
fxruby-1.6.23-x86-mingw32 examples/rmagick.rb
fxruby-1.6.23 examples/rmagick.rb