new

new(*args) Class Public methods Create a new image with the given options. Examples of use : Create an empty image of 300x200 pixels image = TkPhotoImage.new(:height => 200, :width => 300) Create an image from a file image = TkPhotoImage.new(:file: => 'my_image.gif') Options Photos support the following options: :data Specifies the contents of the image as a string. :format Specifies the name of the file format for the data. :file Gives the name of a file that is to

blank

blank() Instance Public methods Blank the image; that is, set the entire image to have no data, so it will be displayed as transparent, and the background of whatever window it is displayed in will show through.

cget

cget(option) Instance Public methods Returns the current value of the configuration option given by option. Example, display name of the file from which image was created: puts image.cget :file

cget_strict

cget_strict(option) Instance Public methods

copy

copy(src, *opts) Instance Public methods Copies a region from the image called source to the image called destination, possibly with pixel zooming and/or subsampling. If no options are specified, this method copies the whole of source into destination, starting at coordinates (0,0) in destination. The following options may be specified: :from [x1, y1, x2, y2] Specifies a rectangular sub-region of the source image to be copied. (x1,y1) and (x2,y2) specify diagonally opposite corner

data

data(keys={}) Instance Public methods Returns image data in the form of a string. The following options may be specified: :background color If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. :format format-name Specifies the name of the image file format handler to be used. Specifically, this subcommand searches for the first handler whose name matches an initial substrin

get

get(x, y) Instance Public methods Returns the color of the pixel at coordinates (x,y) in the image as a list of three integers between 0 and 255, representing the red, green and blue components respectively.

get_transparency

get_transparency(x, y) Instance Public methods Returns a boolean indicating if the pixel at (x,y) is transparent.

put

put(data, *opts) Instance Public methods

read

read(file, *opts) Instance Public methods