ruby-****@sourc*****
ruby-****@sourc*****
2013年 3月 26日 (火) 05:20:57 JST
------------------------- REMOTE_ADDR = 70.49.48.128 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dancr-rbcatut ------------------------- @@ -375,6 +375,33 @@ {{image_right("123-05-fill.png")}} + The ((<cairo_fill()|URL:http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-fill>)) operation instead uses the path like the lines of a coloring book, and allows the source through the mask within the hole whose boundaries are the path. For complex paths (paths with multiple closed sub-paths様ike a donut熔r paths that self-intersect) this is influenced by the ((<fill rule|URL:http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-fill-rule>)). Note that while stroking the path transfers the source for half of the line width on each side of the path, filling a path fills directly up to the edge of the path and no further. + + {{br}}{{image_right("1203-p05-00-stroke.png")}} + + #!/usr/bin/env ruby + $: << '~/work/HikiLib' + require 'hiki2-gtk-w-cairo.rb' + include HikiGtk + class StrokeDemo < CairoWindow + def draw(cr, da) + #width, height = da.window.size + # Your code goes between the two dashed lines: + # -- your code - start ----------------------------------------- -s- + cr.scale(120, 120) + cr.line_width = 0.1 + cr.set_source_rgb(0, 0, 0) + cr.rectangle(0.25, 0.25, 0.5, 0.5) + cr.stroke + # -- your code - end ------------------------------------------- -e- + end + end # // EndOf class StrokeDemo + window = StrokeDemo.new("Stroke Tut. Example") + window.show_all + Gtk.main + + + :Show Text / Glyphs (12.3.1.2.3){{br}}