indexing description: "Bitmap object used for EV_PIXMAP masking" date: "$Date$" revision: "$Revision$" class EV_BITMAP inherit EV_DRAWABLE redefine implementation, create_implementation end create default_create , make_with_size feature {NONE} -- Initialization make_with_size (a_width, a_height: INTEGER) is -- Create with `a_width' and `a_height'. require a_width_positive: a_width > 0 a_height_positive: a_height > 0 do default_create set_size (a_width, a_height) ensure then width_assigned: width = a_width height_assigned: height = a_height end feature -- Status Setting set_size (a_width, a_height: INTEGER) is -- Assign `a_width' and `a_height' to `width' and `weight'. -- Do not stretch image. -- May cause cropping. require not_destroyed: not is_destroyed a_width_positive: a_width > 0 a_height_positive: a_height > 0 do implementation.set_size (a_width, a_height) ensure width_assigned: width = a_width height_assigned: height = a_height end feature -- Access width: INTEGER is -- Horizontal size in pixels. do Result := implementation.width ensure then bridge_ok: Result = implementation.width positive: Result > 0 end height: INTEGER is -- Vertical size in pixels. do Result := implementation.height ensure then bridge_ok: Result = implementation.height positive: Result > 0 end feature {EV_ANY, EV_ANY_I} -- Implementation implementation: EV_BITMAP_I -- Responsible for interaction with native graphics toolkit. feature {NONE} -- Implementation create_implementation is -- See `{EV_ANY}.create_implementation'. do create {EV_BITMAP_IMP} implementation.make (Current) end end