Class: Iup::ImageWidget
Overview
Parent class of images provides common attributes.
See also: Image, ImageRGB, ImageRGBA, Iup.load_image.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#assign_handle ⇒ Object
:attr_writer: assign_handle The name for referring to image.
-
#bpp ⇒ Object
:attr_reader: bpp Returns the number of bits per pixel.
-
#channels ⇒ Object
:attr_reader: channels Returns the number of channels.
-
#height ⇒ Object
:attr_reader: height Height of the image, in pixels.
-
#hotspot ⇒ Object
:attr: hotspot “x:y”, coordinates of spot in image used for mouse click.
-
#rastersize ⇒ Object
:attr_reader: rastersize Size of the image, in pixels, value as “widthxheight”.
-
#save(filename, format = 'png') ⇒ Object
Saves image to given filename.
-
#wid ⇒ Object
:attr_reader: wid Native widget identifier.
-
#width ⇒ Object
:attr_reader: width Width of the image, in pixels.
Methods inherited from Widget
#active, #bgcolor, #destroy, #enterwindow_cb=, #fgcolor, #font, #getfocus_cb=, #help_cb=, #k_any=, #killfocus_cb=, #leavewindow_cb=, #map_cb=, #maxsize, #minsize, #open_controls, #size, #unmap_cb=, #visible, #zorder
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_reader, #define_id_writer, #define_property_attribute, #define_property_reader, #define_property_writer, #define_reader, #define_writer
Methods included from CallbackSetter
Instance Method Details
#assign_handle ⇒ Object
:attr_writer: assign_handle The name for referring to image.
27 |
# File 'lib/wrapped/image.rb', line 27 define_writer :assign_handle |
#bpp ⇒ Object
:attr_reader: bpp Returns the number of bits per pixel.
32 |
# File 'lib/wrapped/image.rb', line 32 define_reader :bpp |
#channels ⇒ Object
:attr_reader: channels Returns the number of channels.
37 |
# File 'lib/wrapped/image.rb', line 37 define_reader :channels |
#height ⇒ Object
:attr_reader: height Height of the image, in pixels.
42 |
# File 'lib/wrapped/image.rb', line 42 define_reader :height |
#hotspot ⇒ Object
:attr: hotspot “x:y”, coordinates of spot in image used for mouse click. Default is “0:0”.
48 |
# File 'lib/wrapped/image.rb', line 48 define_attribute :hotspot |
#rastersize ⇒ Object
:attr_reader: rastersize Size of the image, in pixels, value as “widthxheight”.
53 |
# File 'lib/wrapped/image.rb', line 53 define_reader :rastersize |
#save(filename, format = 'png') ⇒ Object
Saves image to given filename. Optional format is one of: “BMP”, “JPEG”, “GIF”, “TIFF”, “PNG”, “PNM”, “PCX”, “ICO”, etc.
67 68 69 70 71 72 |
# File 'lib/wrapped/image.rb', line 67 def save(filename, format = 'png') err = IupIm.IupSaveImage @handle, filename, format if err.zero? raise Exception, 'Could not save image as file' end end |
#wid ⇒ Object
:attr_reader: wid Native widget identifier.
58 |
# File 'lib/wrapped/image.rb', line 58 define_reader :wid |
#width ⇒ Object
:attr_reader: width Width of the image, in pixels.
63 |
# File 'lib/wrapped/image.rb', line 63 define_reader :width |