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 // [ "requiresSelfDepthTest", // Expects depth testing enabled
31 // "outputIsTransparent", // Might generate transparent alpha from opaque inputs
32 // "outputIsOpaque", // Outputs opaque colors even if the inputs are transparent
33 // "modifiesGeometry" ]; // Might change position of vertices, this option disables any culling optimizations
36 "vertexShader": myVertexShader,
37 "fragmentShader": myFragmentShader,
41 var imageView = new dali.Control("ImageView");
42 imageView.parentOrigin = dali.CENTER;
43 imageView.anchorPoint = dali.CENTER;
44 imageView.size = imageViewSize; // If not set, it will use either the natural image size or the desired image size if any
45 dali.stage.add( imageView );
48 "rendererType" : "imageRenderer",
49 "imageUrl" : "myImage.jpg",
50 "width" : desiredWidth, // The desired image width while loading (optional but preferable to set for efficiency)
51 "height" : desiredHeight, // The desired image height while loading (optional but preferable to set for efficiency)
52 "shader" : shader // Optional
55 imageView.image = image; // assign the image and shader to imageView