ImageView
The image viewer manager class which provides access to the image view API. This exposes the image viewing API to provide functionalities for showing images on the display.
Add the following line for imageView class into a html file your own : <script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js"></script> |
You can declare imageView class like this : ex) var imageView = deviceapis.imageview; |
Contents
Constants
Name | Value | Description |
EFFECT_INIT | -1 | This identifier indicates an initial image transition effect. |
EFFECT_FADE_1 | 0 | This identifier indicates a fade 1 image transition effect. |
EFFECT_FADE_2 | 1 | This identifier indicates a fade 2 image transition effect. |
EFFECT_BLIND | 2 | This identifier indicates a blind image transition effect. |
EFFECT_SPIRAL | 3 | This identifier indicates a spiral image transition effect. |
EFFECT_CHECKER | 4 | This identifier indicates a checker image transition effect. |
EFFECT_LINEAR | 5 | This identifier indicates a linear image transition effect. |
EFFECT_STAIRS | 6 | This identifier indicates a stairs image transition effect. |
EFFECT_WIPE | 7 | This identifier indicates a wipe image transition effect. |
EFFECT_RANDOM | 8 | This identifier indicates a random image transition effect. |
EFFECT_NORMAL | 9 | This identifier indicates a normal image transition effect. |
IMAGEVIEW_STATE_IDLE | 0 | This identifier indicates ImageView is in idle state. |
IMAGEVIEW_STATE_INITIALIZED | 1 | This identifier indicates ImageView has been initialized. |
IMAGEVIEW_STATE_PREPARED | 3 | This identifier indicates ImageView is prepared to draw. |
IMAGEVIEW_STATE_DRAWN | 4 | This identifier indicates that drawing of an image is complete. |
IMAGEVIEW_STATE_STOPPED | 5 | This identifier indicates ImageView is stopped. |
Methods
clear | ||
Description | ||
Deletes images displaying on the page | ||
Parameters | none | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
draw | ||
Description | ||
Reset network information | ||
Parameters | ■SuccessCallback - Function ■ErrorCallback - Function | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
getTransitionEffectList | ||
Description | ||
Reset network information | ||
Parameters | none | |
Return | ■Array - EffectListArray | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
hide | ||
Description | ||
Hides the display area on the tv screen. | ||
Parameters | none | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var gImageViewObj; function onClickHide() { gImageViewObj.hide(); } |
init | ||
Description | ||
This method initializes the ImageView with the proper option. | ||
Parameters | ■option - ImageViewOption | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
prepare | ||
Description | ||
Preapares to load the image to execute transition effect in slideshow mode | ||
Parameters | ■SuccessCallback - Function - This callback occurs when the image displays completely on the screen. If transition effect is used, the event occurs at the point when effect animation is ended. ■ErrorCallback - Function - called it occurs decoding error url option ■url - DOMString ■option (Optional) - ImageOption | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
deviceapis.imageview.prepare(onSuccess, onError, "http://test.jpg", {}); |
setDisplayArea | ||
Description | ||
The SetDisplayArea function sets the display area for video content in TV screen. | ||
Parameters | ■x - Number - Specifies the initial x-coordinate of display area in TV screen coordinates. This x value is smaller than TV screen width, 960. ■y - Number - Specifies the initial y-coordinate of display area in TV screen coordinates. This y value is smaller than TV screen height, 540. ■width - Number - The width of display area. This value is smaller than width of TV screen. ■height - Number - The height of display area from source image. This value is smaller than height of source image. | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Yes | |
SDK Constraint | None | |
Example | ||
. |
setDisplayRect | ||
Description | ||
Sets the area where images are marked. Images are displayed within the area | ||
Parameters | ■displayRect - Rect | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
setSlideShow | ||
Description | ||
set slide show | ||
Parameters | ■start - Boolean | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
setTransitionEffect | ||
Description | ||
The SetTransitionEffect function sets transition effect for slide show. | ||
Parameters | ■effect - Number - Specifies the effect type. The effect types are as follows: * none : -2, * INIT : -1, * FADE1 : 0 * FADE2 : 1, * BLIND : 2, * SPIRAL : 3, * CHECKER : 4, * LINEAR : 5, * STAIRS : 6, * WIPE : 7, * RANDOM : 8 | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Yes | |
SDK Constraint | None | |
Example | ||
. |
setZIndex | ||
Description | ||
This function sets the z-index of the ImageViewer. | ||
Parameters | ■zIndex - Number - z-index | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
show | ||
Description | ||
Shows the display area on the tv screen. | ||
Parameters | none | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var gImageViewObj; function onClickShow() { gImageViewObj.show(); } |