public class HBackgroundImage extends Object
| Parameter | Description | Default value | Set method | Get method |
|---|---|---|---|---|
| None. | ||||
| Description | Default value | Set method | Get method |
|---|---|---|---|
| None. | |||
| Constructor and Description |
|---|
HBackgroundImage(byte[] pixels)
Create an HBackgroundImage object from an array of bytes encoded in the
same encoding format as when reading this type of image data
from a file.
|
HBackgroundImage(String filename)
Create an HBackgroundImage
object.
|
HBackgroundImage(URL contents)
Create an HBackgroundImage
object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flush all the resources used by this image.
|
int |
getHeight()
Determines the height of the image.
|
int |
getWidth()
Determines the width of the image.
|
void |
load(HBackgroundImageListener l)
Load the data for this object.
|
public HBackgroundImage(String filename)
filename - the name of the file to use as the source of
data in a platform-specific URL format.public HBackgroundImage(byte[] pixels)
If this constructor succeeds then the object will automatically
be in the loaded state and calling the load(org.havi.ui.event.HBackgroundImageListener) method shall
immediately generate an HBackgroundImageEvent
reporting success.
If the byte array does not contain a valid image then this
constructor may throw a
java.lang.IllegalArgumentException.
Calling the flush()
method on an object built with this constructor shall have no
effect.
pixels - the data for the HBackgroundImage object encoded
in the specified format for image files of this type.public HBackgroundImage(URL contents)
contents - a URL referring to the data to load.public void load(HBackgroundImageListener l)
Multiple calls to load shall each add an extra
listener, all of which are informed when the loading is
completed. If load is called with the same listener more than
once, the listener shall then receive multiple copies of a single
event.
l - the listener to call when loading of data is
completed.HBackgroundImageEventpublic int getHeight()
The image must have been successfully loaded to completion before this information is guaranteed to be available. It is implementation specific whether this information is available before the image is successfully loaded to completion. An image whose loading failed for any reason shall be considered as having this information unavailable.
public int getWidth()
The image must have been successfully loaded to completion before this information is guaranteed to be available. It is implementation specific whether this information is available before the image is successfully loaded to completion. An image whose loading failed for any reason shall be considered as having this information unavailable.
public void flush()
HBackgroundDevice are not
released.Copyright © 2012 code4tv.com. All Rights Reserved.