Sha256: d309707fba9e82ac732e5a4d15414a794245acbfe40ef41207cde911074f181c

Contents?: true

Size: 1.09 KB

Versions: 74

Compression:

Stored size: 1.09 KB

Contents

require 'fox16'
begin
  require 'RMagick'
rescue LoadError
  warn("LoadError: To execute this app you need to have 'RMagick' gem installed.")
  sleep(5)
  exit(false)
end

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

74 entries across 74 versions & 1 rubygems

Version Path
fxruby-1.6.48 examples/rmagick.rb
fxruby-1.6.48-x64-mingw32 examples/rmagick.rb
fxruby-1.6.48-x64-mingw-ucrt examples/rmagick.rb
fxruby-1.6.48-x86-mingw32 examples/rmagick.rb
fxruby-1.6.47 examples/rmagick.rb
fxruby-1.6.47-x64-mingw-ucrt examples/rmagick.rb
fxruby-1.6.47-x64-mingw32 examples/rmagick.rb
fxruby-1.6.47-x86-mingw32 examples/rmagick.rb
fxruby-1.6.46 examples/rmagick.rb
fxruby-1.6.46-x64-mingw32 examples/rmagick.rb
fxruby-1.6.46-x64-mingw-ucrt examples/rmagick.rb
fxruby-1.6.46-x86-mingw32 examples/rmagick.rb
fxruby-1.6.45 examples/rmagick.rb
fxruby-1.6.45-x64-mingw32 examples/rmagick.rb
fxruby-1.6.45-x64-mingw-ucrt examples/rmagick.rb
fxruby-1.6.45-x86-mingw32 examples/rmagick.rb
fxruby-1.6.44 examples/rmagick.rb
fxruby-1.6.44-x64-mingw32 examples/rmagick.rb
fxruby-1.6.44-x86-mingw32 examples/rmagick.rb
fxruby-1.6.43 examples/rmagick.rb