<< Click to Display Table of Contents >> Navigation: Object Reference > Palette Objects > Picture Graphic |
The Picture Graphic object is a simple object to display static images on the screen.
It is also capable of displaying animated GIF images that makes it possible to show small movies and animations. See GIF properties below.
Note: A free online GIF editor / creator can be found here.
The picture graphic shares some common properties with other objects.
This section only describes the properties that are Picture Graphic specific or differ with the common properties.
The GIF properties are not displayed in the properties table of the Picture Graphic object. They can only be accessed with the JavaScript functions getProperty() and setProperty(). WARNING: Using large animated gif images can slow down the device at runtime significantly. Testing gif images on the target device is strongly recommended! The GIF properties allow to control the playback of GIF animations on the device. The following properties are available: GIF StateUse the GIF State property to control the playback of the video. It can be started, paused or stopped. The values for the GIF State are integers, see below. Default value: 0 (Stop) Possible values: •0 (Stop) •1 (Play) •2 (Pause) Example for how to use this property in a JavaScript: var objectID = 42;
//Start the GIF animation setProperty(objectID, "GIF State", 1);
//Pause the GIF animation: setProperty(objectID, "GIF State", 2);
//Stop the GIF animation setProperty(objectID, "GIF State", 0); Note that the default value is stopped. This means that each animation on each page has to be started manually in a script. If this is not done, only the first frame of the animation will be displayed. GIF SpeedThe playback speed of a GIF animation can be set with this property. If this property is not changed, the animation will run with the speed configured in the GIF itself. Note that large GIF animations might run a little slow when playing them the first time (the images will be cached the first time it is run). The value for this property is the percent speed of the original speed defined in the GIF (100% means unchanged speed). Default value: 100% Possible values: 1 ... 34359738367% (it is not recommended to set such a high speed) Example for setting 50% (half) speed for an animation: var objectID = 42; setProperty(objectID, "GIF Speed", 50); GIF LoopsThis property is a boolean property that controls if the animation will loop to the start of the animation when it's end is reached. Default value: true Possible values: •true - Begin at start of animation when end of animation is reached •false - Stop animation when end of animation is reached Integrated in GIF files is a number of loop repetitions information, so even if looping is set to true, after a certain amount of repititions the animation will stop. Sadly this information is hardly editable in GIF-editors. Example for setting the GIF Loops property: var objectID = 42;
//Stop animation when end is reached: setProperty(objectID, "GIF Loops", false);
//Enable looping: setProperty(objectID, "GIF Loops", true); GIF Frame NumberIt is possible to jump to a certain frame number of the GIF animation. Like this an animation can be played frame by frame or jump to a special frame. Default value: 0 Possible values: 0 (first frame) ... number of frames of the GIF animation If a number greater than the actual number of frames of the animation is set, it will be ignored. Example: var objectID = 42;
//Jump to frame 5 setProperty(objectID, "GIF Frame Number", 5); Note: Frame counting starts at 0. |