Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

Gdk::Image

class Gdk::Image

The Gdk::Image type represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible Gdk::RGB methods.

Class Methods

Gdk::Image.new(type, visual, width, height)
Creates a new Gdk::Image.

Instance Methods

image_type
Gets the type of the image.
visual
Gets the visual.
width
Gets the width of the image in pixels.
  • Returns: the width of the image in pixels.
height
Gets the height of the image in pixels.
  • Returns: the height of the image in pixels.
depth
Gets the depth of the image, i.e. the number of bits per pixel
  • Returns: the depth of the image.
bpp
Gets the number of bytes per pixel.
  • Returns: the number of bytes per pixel
bpl
Gets the number of bytes per line of the image.
  • Returns: the number of bytes per of the image.
bits_per_pixel
Gets the number of bits per pixel.
  • Returns: the number of bits per pixel.
colormap
Retrieves the colormap for a given image, if it exists. An image will have a colormap if the drawable from which it was created has a colormap, or if a colormap was set explicitely with Gdk::Image#colormap=.
  • Returns : colormap for the image
colormap=(colormap)
Sets the colormap for the image to the given colormap. Normally there's no need to use this method, images are created with the correct colormap if you get the image from a drawable. If you create the image from scratch, use the colormap of the drawable you intend to render the image to.
set_colormap(colormap)
Same as Gdk::Image#colormap=.
put_pixel(x, y, pixel)
Sets a pixel in a Gdk::Image to a given pixel value.
  • x: the x coordinate of the pixel to set.
  • y: the y coordinate of the pixel to set.
  • pixel: the pixel value to set.
  • Returns: self
get_pixel(x, y)
Gets a pixel value at a specified position in a Gdk::Image.
  • x: the x coordinate of the pixel to get.
  • y: the y coordinate of the pixel to get.
  • Returns: the pixel value at the given position.
byte_order
  • Returns: self: FIXME

Constants

GdkImageType

Specifies the type of a Gdk::Image.

NORMAL
The original X image type, which is quite slow since the image has to be transferred from the client to the server to display it.
SHARED
A faster image type, which uses shared memory to transfer the image data between client and server. However this will only be available if client and server are on the same machine and the shared memory extension is supported by the server.
FASTEST
Specifies that Gdk::Image::SHARED should be tried first, and if that fails then Gdk::Image::NORMAL will be used.
Last modified:2008/04/10 11:01:32
Keyword(s):
References:[Gdk::Image::Type] [Gdk::Pixbuf] [api-gdk-index] [Gdk::Drawable] [News_20031116_1] [Gdk::Colormap] [Gdk::Visual] [Ruby/GDK] [Gdk::Image] [Gtk::Image] [index-ruby-gdk2]