File: orig_coord_sys.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-- 548 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rvg/rvg'

rvg = Magick::RVG.new(400, 150) do |canvas|
  canvas.desc = 'Example - Simple transformations: original picture'
  canvas.background_fill = 'white'

  canvas.g.styles(fill: 'none', stroke: 'black', stroke_width: 3) do |grp|
    # Draw the axes of the original coordinate system
    grp.line(0, 1.5, 400, 1.5)
    grp.line(1.5, 0, 1.5, 150)
  end

  canvas.text(30, 30, 'ABC (orig coord system)').styles(font_size: 20, font_family: 'Verdana', font_weight: 'normal', font_style: 'normal')
end

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