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

Zurück zum Archiv-Index

ruby-****@sourc***** ruby-****@sourc*****
2013年 4月 2日 (火) 08:58:58 JST


-------------------------
REMOTE_ADDR = 70.49.48.128
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?Cairo%3A%3AContext
-------------------------
@@ -6,9 +6,9 @@
 
 Before you can start to draw something with cairo, you need to create the cairo context. In Ruby/Gtk you obtain context with Gdk::Drawable#create_cairo_context instance method. Note, you do not supply the ((<source|URL:http://www.cairographics.org/manual/cairo-surfaces.html>)) to cairo create method. Instead, you invoke the((*create_cairo_context*)) instance method on a Gdk::Drawable object, which can be either Gdk::Pixmap,  or a Gdk::Window. (Original GTK API for Gdk::Drawable also lists((*bitmap,*)) however, it fails to identify it sufficiently?)
 
-Though in Ruby/Gtk this originally was the only documented method of creating cairo context, that proves to be too limiting, especially when you have to gain access the some Cairo methods not available in Ruby/Gtk Cairo implementation. For that you need to((*require 'cairo'*)) module, which is from the Gtk completely separate and independent library. In fact you do not even need to run any particular GUI library, to utilize the power of this 'stand-alone' 2D Cairo Vector Graphics Library. Indeed, since this library does not rely on external graphic interface or Window system, it provides its own mechanisms to create cairo context, which of course must now be bound to some other than your Gtk/Window drawing area or drawing ((*surface.*)) However, currently in Ruby/Gtk, other than active Gtk Window surfaces are not available. This is where the stand-alone Cairo library kicks in. It  actually also provides functions (methods) to create such drawing surfaces (see Ruby Cairo Tuto
 rial, section 12.3.0.2 ((<Running Cairo Code From Non-Gtk Ruby Environment|tut-gtk2-dancr-rbcatut-intro#Running Cairo Code From Non-Gtk Ruby Environment>)), for hints how to write cairo drawing programs outside of a Gtk graphic window.)
+Though in Ruby/Gtk this originally was the only documented method of creating cairo context, that proves to be too limiting, especially when you have to gain access the some Cairo methods not available in Ruby/Gtk Cairo implementation. For that you need to((*require 'cairo'*)) module, which is from the Gtk completely separate and independent library. In fact you do not even need to run any particular GUI library, to utilize the power of this 'stand-alone' 2D Cairo Vector Graphics Library. Indeed, since this library does not rely on external graphic interface or Window system, it provides its own mechanisms to create cairo context, which of course must now be bound to some other than your Gtk/Window drawing area or drawing ((*surface.*)) However, currently in Ruby/Gtk, other than active Gtk Window surfaces are not available. This is where the stand-alone Cairo library kicks in. It  actually also provides functions (methods) to create such drawing surfaces (see: Ruby Cairo Tut
 orial, section 12.3.0.2 ((<Running Cairo Code From Non-Gtk Ruby Environment|tut-gtk2-dancr-rbcatut-intro#Running Cairo Code From Non-Gtk Ruby Environment>)), for hints how to write cairo drawing programs outside of a Gtk graphic window.)
 
-Whether you create a cairo context in Ruby/Gtk or in a non-GUI character based programming environment, it is eventually bound to a drawing surface, which indeed can be some kind of backend, either a file or a GUI window (see Ruby Cairo Tutorial, section 12.3.0.1.1 ((<Cairo Backends|tut-gtk2-dancr-rbcatut-intro#Cairo Backends>)) to learn about surfaces Gtk/Cairo environment does not support).
+Whether you create a cairo context in Ruby/Gtk or in a non-GUI character based programming environment, it is eventually bound to a drawing surface, which indeed can be some kind of backend, either a file or a GUI window (see: Ruby Cairo Tutorial, section 12.3.0.1.1 ((<Cairo Backends|tut-gtk2-dancr-rbcatut-intro#Cairo Backends>)) to learn about surfaces Gtk/Cairo environment does not support).
 
 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.
 




ruby-gnome2-cvs メーリングリストの案内
Zurück zum Archiv-Index