[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - Cairo::Context

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2013年 4月 2日 (火) 09:06:49 JST


-------------------------
REMOTE_ADDR = 70.49.48.128
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?Cairo%3A%3AContext
-------------------------
@@ -12,6 +12,14 @@
 
 Whatever the target drawing surface is, you use the drawing options on the cairo context, to create shapes with methods like cr.move_to() and cr.line_to(), and then draw shapes with cr.stroke() or cr.fill(), where, indeed, the receiver object((*"cr",*))is cairo context created either with the Gdk::Drawable#create_cairo_context method in Gtk/Cairo environment, or by combining a creation of a drawing surface and binding it to to the cairo context created by the ((<rCairo:_:Context.new(surface)|URL:http://cairo.rubyforge.org/doc/en/cairo-context.html#label-4>)) method available from in the 'stand-alone' Cairo Graphics Library.
 
+:creating cairo context for rcairo:
+    When you are using stand-alone non-GUI cairo library, you should forget, about Ruby's Gdk::Drawable#create_cairo_context, and resort to plain old Cairo ways of creating it via:
+
+     surface = Cairo::XyzSurface.new(width, height)
+     cr = Cairo::Context.new(surface)
+
+    by replacing the word "Xyz" above with one of the following { Image, PDF, PS, SVG, ... }.
+
 {{br}}
 
 There are only GDK and Pango related APIs.




ruby-gnome2-cvs メーリングリストの案内
Back to archive index