File: circle01.rb

package info (click to toggle)
ruby-rmagick 6.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,232 kB
  • sloc: cpp: 19,563; ruby: 17,147; sh: 88; javascript: 36; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(12.cm, 4.cm) do |canvas|
  canvas.viewbox(0, 0, 1200, 400)
  canvas.background_fill = 'white'
  canvas.desc = 'Example circle01 - circle filled with red and stroked with blue'

  # Show outline of canvas using the 'rect' method
  canvas.rect(1195, 395, 1, 1).styles(fill: 'none', stroke: 'blue', stroke_width: 2)

  canvas.circle(100, 600, 200).styles(fill: 'red', stroke: 'blue', stroke_width: 10)
end

rvg.draw.write('circle01.gif')