class Iup::ImageWidget

Parent class of images provides common attributes.

Attributes

assign_handle

write-only sets the name for referring to image.

bpp

read-only Returns the number of bits per pixel.

channels

read-only Returns the number of channels.

color

index, “r g b” -> gets/sets colour index. (Used only in 8-bit images created using Image)

colour

index, “r g b” -> gets/sets colour index. (Used only in 8-bit images created using Image)

height

read-only Height of the image, in pixels.

hotspot

“x:y”, coordinates of spot in image used for mouse click. Default is “0:0”.

rastersize

read-only Size of the image, in pixels, value as “widthxheight”.

wid

read-only Native widget identifier.

width

read-only Width of the image, in pixels.

Public Instance Methods

save(filename, format = 'png') click to toggle source

Saves image to given filename. Optional format is one of: “BMP”, “JPEG”, “GIF”, “TIFF”, “PNG”, “PNM”, “PCX”, “ICO”, etc.

# File lib/wrapped/image.rb, line 49
def save filename, format = 'png'
  err = IupIm.IupSaveImage @handle, filename, format
  if err.zero?
    raise Exception, 'Could not save image as file'
  end
end