Add more shared C++/JavaScript docs and add JavaScript wrapping guide
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / docs / content / resource-image.js
1 /**
2  *
3 ## ResourceImage (extends Image)
4
5 A resource image extends the basic {{#crossLink "image"}}Image class{{/crossLink}} with
6 the ability to load an image from a file.
7
8 ResourceImage supports two types of load policies
9
10 - dali.IMAGE_LOAD_POLICY_IMMEDIATE //  load image once it is created (default)
11 - dali.IMAGE_LOAD_POLICY_ON_DEMAND // delay loading until the image is being used (a related actor is added to Stage)
12   
13 ### Simple example
14 ```
15
16 var image = new dali.ResourceImage( { url:"my_image.png" } );
17
18 var imageActor = new dali.ImageActor( image );
19
20 ```
21 ### Advanced example
22 ```
23
24 function imageLoaded( image )
25 {
26   log("image loaded " +image.url + "\n");
27 }
28
29 var options = {
30   url:"my_image.png",
31   loadPolicy:dali.IMAGE_LOAD_POLICY_IMMEDIATE,
32   releasePolicy: dali.IMAGE_RELEASE_POLICY_UNUSED
33 }
34 var image = new dali.ResourceImage( options );
35
36 image.connect("image-loading-finished", finished );
37
38 var imageActor = new dali.ImageActor( image );
39
40 ```
41 @class ResourceImage
42 @extends Image
43  */