-
Notifications
You must be signed in to change notification settings - Fork 2
/
arcs01.rb.html
55 lines (50 loc) · 1.94 KB
/
arcs01.rb.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE public PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta name="generator" content="ex2html.rb" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/popup.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>
hljs.configure({ cssSelector: "pre" });
hljs.highlightAll();
</script>
<title>RMagick example: arcs01.rb</title>
</head>
<body>
<h1>arcs01.rb</h1>
<div class="bodybox">
<div class="bodyfloat">
<pre class="language-ruby">
# frozen_string_literal: true
require 'rvg/rvg'
Magick::RVG.dpi = 90
rvg = Magick::RVG.new(12.cm, 5.25.cm).viewbox(0, 0, 1200, 400) do |canvas|
canvas.title = 'Example arcs01 - arc commands in path data'
canvas.desc = <<-END_DESC
Picture of a pie chart with two pie wedges and a picture
of a line with arc blips
END_DESC
canvas.background_fill = 'white'
canvas.rect(1196, 395, 1, 1).styles(fill: 'none', stroke: 'blue', stroke_width: 1)
canvas.path('M300,200 h-150 a150,150 0 1,0 150,-150 z')
.styles(fill: 'red', stroke: 'blue', stroke_width: 5)
canvas.path('M275,175 v-150 a150,150 0 0,0 -150,150 z')
.styles(fill: 'yellow', stroke: 'blue', stroke_width: 5)
canvas.path(<<-END_PATH)
M600,350 l 50,-25
a25,25 -30 0,1 50,-25 l 50,-25
a25,50 -30 0,1 50,-25 l 50,-25
a25,75 -30 0,1 50,-25 l 50,-25
a25,100 -30 0,1 50,-25 l 50,-25
END_PATH
.styles(fill: 'none', stroke: 'red', stroke_width: 5)
end
rvg.draw.write('arcs01.gif')
</pre>
</div>
</div>
<div id="close"><a href="javascript:window.close();">Close window</a></div>
</body>
</html>