Class: DYI::Shape::Image
- Defined in:
- lib/dyi/shape/base.rb
Overview
Direct Known Subclasses
Constant Summary
Constants inherited from GraphicalElement
GraphicalElement::CLASS_REGEXP
Constants inherited from Element
Instance Attribute Summary collapse
- #file_path ⇒ Object readonly
Attributes inherited from Base
#anchor_href, #anchor_target, #attributes, #clipping, #parent
Attributes inherited from GraphicalElement
Attributes inherited from Element
Instance Method Summary collapse
-
#has_uri_reference? ⇒ Boolean
Whether the element has a URI reference.
-
#initialize(left_top, width, height, file_path, options = {}) ⇒ Image
constructor
A new instance of Image.
- #write_as(formatter, io = $>) ⇒ Object
Methods inherited from Rectangle
#bottom, #center, create_on_corner, create_on_width_height, #left, #right, #top
Methods inherited from Base
#add_animation, #add_painting_animation, #add_transform_animation, #animate?, #animations, #clear_clipping, #draw_on, #has_marker?, #root_element?, #root_node?, #rotate, #scale, #set_clipping, #set_clipping_shapes, #set_event, #skew_x, #skew_y, #transform, #translate
Methods inherited from GraphicalElement
#add_css_class, #add_event_listener, #css_classes, #event_listeners, #event_target?, #remove_css_class, #remove_event_listener, #set_event, #to_reused_source
Methods inherited from Element
#canvas, #child_elements, #id, #id=, #include_external_file?, #inner_id
Constructor Details
#initialize(left_top, width, height, file_path, options = {}) ⇒ Image
Returns a new instance of Image.
749 750 751 752 |
# File 'lib/dyi/shape/base.rb', line 749 def initialize(left_top, width, height, file_path, ={}) super(left_top, width, height, ) @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
740 741 742 |
# File 'lib/dyi/shape/base.rb', line 740 def file_path @file_path end |
Instance Method Details
#has_uri_reference? ⇒ Boolean
Returns whether the element has a URI reference.
755 756 757 |
# File 'lib/dyi/shape/base.rb', line 755 def has_uri_reference? true end |
#write_as(formatter, io = $>) ⇒ Object
759 760 761 |
# File 'lib/dyi/shape/base.rb', line 759 def write_as(formatter, io=$>) formatter.write_image(self, io, &(block_given? ? Proc.new : nil)) end |