Tizen Native API
|
In this example, we add two images to a canvas, each one having a quarter of the canvas' size, positioned on the top left and bottom right corners, respectively:
To interact with the program, there's a command line interface. A help string can be asked for with the 'h' key:
The 'f' command will toggle that image's "filled" property, which is whether it should track its size and set the fill one to fit the object's boundaries perfectly (stretching). Note that this command and the four above it will conflict: in real usage one would use one or other ways of setting an image object's viewport with regard to its image source.
There are four commands which deal with the border image. This red frame is there to illustrate image borders. The image source for the border is a solid red rectangle, with a transparent rectangular area in its middle. See how we use it to get a 3 pixel wide frame with evas_object_image_border_set(d.border, 3, 3, 3, 3)
. To finish the effect of showing it as a border, we issue evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE)
.
Use 't' to change the border's thickness. 'b' will change the border image's center region rendering schema: either a hole (no rendering), blending (see the original transparent area, in this case) or solid (the transparent area gets filled). Finally, 'c' will change the border's scaling factor.
While you have the border in 'blending mode', test the command 'm': it will set whether to use or not smooth scaling on the border's source image. Since the image is small originally (30 x 30), we're obviously up-scaling it (except the border pixels, do you remember?). With this last switch, you'll either see the transparent shape in the middle flat (no smoothing) or blurry (smoothed).
The full example follows.