J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software

scaling-image Background

You can automatically scale background images to the required size using the scaling-image background on MIDP 2.0+ devices.
This allows you to use a single set of image resources for various devices.


scaling-image background

.screenMain {
	layout: horizontal-center | vertical-center;
	margin: 0;
	padding: 10;
	background {
		//#if polish.midp2
			type: scaling-image;
		image: url( splash.png );
		color: #FDFFFC;
		scale-mode: proportional;
		anchor: bottom | right;
		x-offset: -5;
		y-offet: -5;
		top: title;
		bottom: menubar;

CSS attributes:

CSS Attribute  DefaultValuesExplanationSince
color white color The color of the background or transparent. 1.3
image none image-url URL of the image that might require scaling. 1.3
scale-mode none none, scale, proportional, expand The scaling mode. Scale scales the image unproportionally. Proportional scales the image so that it completely fits into the given dimensions. Expand scales it maximally for either the width or the height of the background. 1.3
anchor left | top left, horizontal-center, h-center, hcenter, center, right, top, vertical-center, v-center, vcenter, bottom Position of the image within the background. 1.3
x-offset 0 integer Horizontal adjustment in pixels. A negative value moves the image to the left. 1.3
y-offset 0 integer Vertical adjustment in pixels. A negative value moves the image to the top. 1.3


back to top