UIEvolutin Inc.
UJML Language Reference
Image Support

Determining device picture support.

UJML provides several different ways to determine the device context for images. See Images.

Determining supported file types

Different devices support different bitmap file types. See Images. The _isSupported() function may be called with one of the file type feature support entities to determine if it supports that bitmap file type. See _isSupported() function, Feature Support Information Entities. You can determine a device's preferred bitmap file type by calling the _getStringProperty() function with the &_PROPERTY_STRING_PREFERRED_IMAGE_EXTENSION; device information entity. See _getStringProperty() function, String Device Information Entities

Use the _image_url() function to append the file extension for the device's preferred image file format to a file name. See _image_url() function. For example calling '_image_url("http://myserver/app/startupimage")' on a device where the preferred extension is '.png' will return 'http://myserver/app/startupimage.png'.

Determining alpha opacity support

Alpha opacity for images works exactly like the alpha opacity portion of a UJML color. See UJML Colors

Not all devices support alpha opacity. See Color Support.

Determining area transparency support

Not all devices support transparent areas in images. You can determine device support for transparency by calling the _getBooleanProperty() function with the &_PROPERTY_BOOLEAN_TRANSPARENCY_SUPPORTED; device information entity. See _getBooleanProperty() function, Boolean Device Information Entities.

Determining image scaling support

Not all devices support scaling images. You can determine device support for scaling by calling the _isSupported() function with the &_X_IMAGE_SCALING; device information entity. See _isSupported() function, Feature Support Information Entities.

The following example shows how to load a variable with the URL of an image. It is part of the visualelements.ujml sample.

mImageURL = _image_url("img/smiley");
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
What do you think about this topic? Send feedback!