Sha256: b8cd57774ee644ff4c8a5d4323c56619936f3e43f2a7148ad6e13eb15086e7f9

Contents?: true

Size: 654 Bytes

Versions: 38

Compression:

Stored size: 654 Bytes

Contents

#! /usr/local/bin/ruby -w

require 'RMagick'
include Magick

canvas = Image.new(260, 125)
gc = Draw.new
gc.fill('black')
gc.rectangle(10,20, 250,90)

gc.stroke('blue')
gc.fill('yellow')
gc.stroke_width(10)

gc.opacity('25%')
gc.roundrectangle(20,20, 60,90, 5,5)

gc.opacity('50%')
gc.roundrectangle(80,20, 120,90, 5,5)

gc.opacity(0.75)
gc.roundrectangle(140,20, 180,90, 5,5)

gc.opacity(1)
gc.roundrectangle(200,20, 240,90, 5,5)

gc.stroke('transparent')
gc.fill('black')
gc.gravity(SouthGravity)
gc.text(-90,20, '"25%%"')
gc.text(-30,20, '"50%%"')
gc.text( 30,20, '"75%%"')
gc.text( 90,20, '"100%%"')

gc.draw(canvas)

canvas.write("opacity.gif")
exit

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rmagick-1.10.0 doc/ex/opacity.rb
rmagick-1.10.1 doc/ex/opacity.rb
rmagick-1.13.0 doc/ex/opacity.rb
rmagick-1.11.0 doc/ex/opacity.rb
rmagick-1.11.1 doc/ex/opacity.rb
rmagick-1.12.0 doc/ex/opacity.rb
rmagick-1.15.1 doc/ex/opacity.rb
rmagick-1.14.0 doc/ex/opacity.rb
rmagick-1.14.1 doc/ex/opacity.rb
rmagick-1.15.0 doc/ex/opacity.rb
rmagick-1.15.10 doc/ex/opacity.rb
rmagick-1.15.14 doc/ex/opacity.rb
rmagick-1.15.11 doc/ex/opacity.rb
rmagick-1.15.12 doc/ex/opacity.rb
rmagick-1.15.13 doc/ex/opacity.rb
rmagick-1.15.15 doc/ex/opacity.rb
rmagick-1.15.3 doc/ex/opacity.rb
rmagick-1.15.16 doc/ex/opacity.rb
rmagick-1.15.17 doc/ex/opacity.rb
rmagick-1.15.2 doc/ex/opacity.rb