5 DALi ImageView can be used to display an image.
7 It is preferable to set a valid size to the image for efficiency. However, do not set size
8 that is bigger than the actual image size, as the up-scaling is not available, the content
9 of the area not covered by actual image is undefined and it will not be cleared.
12 ### Simple example of creating an ImageView
15 var imageView = new dali.Control("ImageView");
17 imageView.image = "myImage.jpg";
18 imageView.parentOrigin = dali.CENTER;
19 imageView.anchorPoint = dali.CENTER;
21 dali.stage.add( imageView );
24 ### Advanced example of creating an ImageView and applying a GL-ES shader to it
27 // vertexShader = ""; // vertex shader ( optional)
28 // fragmentShader = ""; // fragment shader ( optional)
29 // hints = // shader hints ( optional)
30 // [ "OUTPUT_IS_TRANSPARENT", // Might generate transparent alpha from opaque inputs
31 // "MODIFIES_GEOMETRY" ]; // Might change position of vertices, this option disables any culling optimizations
34 "vertexShader": myVertexShader,
35 "fragmentShader": myFragmentShader,
39 var imageView = new dali.Control("ImageView");
40 imageView.parentOrigin = dali.CENTER;
41 imageView.anchorPoint = dali.CENTER;
42 imageView.size = imageViewSize; // If not set, it will use either the natural image size or the desired image size if any
43 dali.stage.add( imageView );
46 "visualType" : "IMAGE",
47 "url" : "myImage.jpg",
48 "desiredWidth" : desiredWidth, // The desired image width while loading (optional but preferable to set for efficiency)
49 "desiredHeight" : desiredHeight, // The desired image height while loading (optional but preferable to set for efficiency)
50 "shader" : shader // Optional
53 imageView.image = image; // assign the image and shader to imageView