Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.widget.background

Class EM_STRETCHED_BITMAP_BACKGROUND


Direct ancestors

EM_BITMAP_BACKGROUND

Creation

Features

Invariants

indexing

description

Background with a stretched bitmap.
The bitmap will be repeated if necessary.

date

$Date: 2005/10/23 11:10:45 $

revision

$Revision: 1.7 $

class

EM_STRETCHED_BITMAP_BACKGROUND

inherit

EM_BITMAP_BACKGROUND

create

make_from_bitmap (a_bitmap: like bitmap)

-- Initialise background with image a_bitmap.

-- (From EM_BITMAP_BACKGROUND)

require
a_bitmap_not_void: a_bitmap /= Void
ensure
bitmap_set: bitmap = a_bitmap
make_from_file (a_filename: STRING)

-- Initialise background with image denoted by a_filename.

-- (From EM_BITMAP_BACKGROUND)

require
a_filename_not_void: a_filename /= Void
ensure
bitmap_created: bitmap /= Void
make_from_bitmap_stretched (a_bitmap: like bitmap; a_width, a_height: INTEGER)

-- Initialise background with a_bitmap and new bitmap dimensions a_width a_height.

require
a_bitmap_not_void: a_bitmap /= Void
a_width_positive: a_width > 0
a_height_positive: a_height > 0
ensure
bitmap_set: bitmap /= Void
bitmap_width_set: bitmap.width = a_width
bitmap_height_set: bitmap.height = a_height
make_from_file_stretched (a_filename: STRING; a_width, a_height: INTEGER)

-- Initialise background with image denoted by a_filename and
-- new bitmap dimensions a_width a_height.

require
a_filename_not_void: a_filename /= Void
a_width_positive: a_width > 0
a_height_positive: a_height > 0
ensure
bitmap_set: bitmap /= Void
bitmap_width_set: bitmap.width = a_width
bitmap_height_set: bitmap.height = a_height

feature -- Access

bitmap: EM_BITMAP

-- Bitmap that is drawn as background

-- (From EM_BITMAP_BACKGROUND)

feature -- Element change

set_bitmap (a_bitmap: like bitmap)

-- Set bitmap to a_bitmap.

-- (From EM_BITMAP_BACKGROUND)

require
a_bitmap_not_void: a_bitmap /= Void
ensure
bitmap_set: bitmap = a_bitmap

feature -- Drawing

draw_on (a_widget: EM_WIDGET)

-- Draw background on a_widget.

-- (From EM_BACKGROUND)

require
a_widget_not_void: a_widget /= Void

invariant

bitmap_not_void: bitmap /= Void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end