[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] create - RSVG::Handle

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2005年 10月 3日 (月) 17:37:04 JST


-------------------------
REMOTE_ADDR = 160.29.201.22
REMOTE_HOST = 
REMOTE_USER = ruby-gnome2-hiki
        URL = /hiki.cgi?RSVG%3A%3AHandle
-------------------------
TITLE       = RSVG::Handle
KEYWORD     = 
= class RSVG::Handle

== Object Hierarchy
* Object
  * RSVG::Handle

== Class Methods
--- RSVG::Handle.new(gz=nil)

     Returns a new rsvg handle. This handle can be used for
     dynamically loading an image. You need to feed it data
     using RSVG::Handle#write, then call RSVG::Handle#close
     when done. No more than one image can be loaded with
     one handle.

     * gz: Specify (({true})) if you want to handle GZipped
       SVG (svgz) instead of normal SVG (svg).
     * Returns: A new RSVG::Handle

== Instance Methods
--- close

     Closes (({self})), to indicate that loading the image
     is complete. This will return (({true})) if the loader
     closed successfully.

     * Returns: (({true})) if the loader closed
       successfully, raises RSVG::Error if there was an
       error, or (({nil})) if the loader already closed.

--- closed?
     
     * Returns: Whether closed or not

--- desc

     Returns the SVG's description in UTF-8 or (({nil})).
     
     * Returns: The SVG's description

--- pixbuf

     Returns the pixbuf loaded by handle. If insufficient
     data has been read to create the pixbuf, or an error
     occurred in loading, then (({nil})) will be
     returned. Note that the pixbuf may not be complete
     until RSVG::Handle#close has been called.
     
     * Returns: the pixbuf loaded by handle, or (({nil})).

--- pixbuf_from_file(file_name)

     ((*Obsolete since 2.12*))

     Loads a new Gdk::Pixbuf from (({file_name})) and
     returns it. If an error occurred, raises an exception.
     (({self})) is closed by this call.
     
     * file_name: A file name
     * Returns: A newly allocated Gdk::Pixbuf, or raises an
       exception.

--- pixbuf_from_file_at_max_size(file_name, max_width, max_height)

     ((*Obsolete since 2.12*))

     Loads a new Gdk::Pixbuf from (({file_name})) and
     returns it. This pixbuf is uniformly scaled so that the
     it fits into a rectangle of size (({max_width})) *
     (({max_height})). If an error occurred, raises an exception.
     (({self})) is closed by this call.

     * file_name: A file name
     * max_width: The requested max width
     * max_height: The requested max height
     * Returns: A newly allocated Gdk::Pixbuf, or raises an
       exception.

--- pixbuf_from_file_at_size(file_name, width, height)

     ((*Obsolete since 2.12*))

     Loads a new Gdk::Pixbuf from (({file_name})) and
     returns it. This pixbuf is scaled from the size
     indicated to the new size indicated by (({width})) and
     (({height})). If either of these are -1, then the
     default size of the image being loaded is used. If an
     error occurred, raises an exception.
     (({self})) is closed by this call.

     * file_name: A file name
     * width: The new width, or -1
     * height: The new height, or -1
     * Returns: A newly allocated Gdk::Pixbuf, or raises an
       exception.
     
--- pixbuf_from_file_at_zoom(file_name, x_zoom, y_zoom)

     ((*Obsolete since 2.12*))

     Loads a new Gdk::Pixbuf from (({file_name})) and
     returns it. This pixbuf is scaled from the size
     indicated by the file by a factor of (({x_zoom})) and
     (({y_zoom})). If an error occurred, raises an exception.
     (({self})) is closed by this call.

     * file_name: A file name
     * x_zoom: The horizontal zoom factor
     * y_zoom: The vertical zoom factor
     * Returns: A newly allocated Gdk::Pixbuf, or raises an
       exception.

--- pixbuf_from_file_at_zoom_with_max(file_name, x_zoom, y_zoom, max_width, max_height)

     ((*Obsolete since 2.12*))

     Loads a new Gdk::Pixbuf from (({file_name})) and
     returns it. This pixbuf is scaled from the size
     indicated by the file by a factor of (({x_zoom})) and
     (({y_zoom})). If the resulting pixbuf would be larger
     than (({max_width}))/(({max_height})) it is uniformly
     scaled down to fit in that rectangle. If an error
     occurred, raises an exception.
     (({self})) is closed by this call.

     * file_name: A file name
     * x_zoom: The horizontal zoom factor
     * y_zoom: The vertical zoom factor
     * max_width: The requested max width
     * max_height: The requested max height
     * Returns: A newly allocated Gdk::Pixbuf, or raises an
       exception.

--- set_dpi_x_y(dpi_x, dpi_y)

     Sets the DPI for the outgoing pixbuf. Common values are
     75, 90, and 300 DPI. Passing a number <= 0 to #dpi_x or
     #dpi_y will reset the DPI to whatever the default value
     happens to be.

     * dpi_x: Dots Per Inch (aka Pixels Per Inch) of x
     * dpi_y: Dots Per Inch (aka Pixels Per Inch) of y
     * Returns: (({nil}))

--- set_size_callback(&block)

     Sets the sizing function for the (({self})). This
     function is called right after the size of the image
     has been loaded. The size of the image is passed in to
     the (({block})), which may then modify these values to
     set the real size of the generated pixbuf. If the image
     has no associated size, then the size arguments are set
     to -1.

     * block: A block for callback is called width and
       height. And return the array of new width and height,
       or (({nil})) if don't change the size.
     * Returns: (({nil}))

--- metadata

     Returns the SVG's metadata in UTF-8 or (({nil})). ((*Since 2.9*))
     
     * Returns: The SVG's metadata

--- title

     Returns the SVG's title in UTF-8 or (({nil})).
     
     * Returns: The SVG's title

--- base_uri

     Gets the base uri for the (({self})). ((*Since 2.9*))

     * Returns: the base URI, possibly ((<nil>))

--- base_uri=(base_uri)

     Set the base URI for this SVG. ((*Since 2.9*))

     * base_uri: the base URI
     * Returns: base_uri

--- set_base_uri(base_uri)

     Same as base_uri=.

     * base_uri: the base URI
     * Returns: self

--- write(buf)

     Loads the image. This will return (({true})) if the
     data was loaded successful, and raise RSVG::Error if an
     error occurred. In the latter case, the loader will be
     closed, and will not accept further writes.
     
     * buf: SVG data
     * Returns: (({true})) if the write was successful, or
       raises RSVG::Error if there was an error.

== See Also

== ChangeLog

* 2005-06-11 ((<kou>)): completed.

- ((<kou>))






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