Table of Contents
The Poster node class draws an image with the top/left corner located at the origin of the node local coordinate system. Because the Poster node class extends the Group node class, a Poster node can have child nodes. For example, a Poster node might have a Label node as a child that draws an annotation on top of the poster.
The Poster node class supports JPEG and PNG image files.
The Poster node class includes the capability to automatically scale graphical images to different sizes as they are loaded, by setting the
loadHeight field values. After the graphical images are loaded, the images can be scaled to fit within the target screen element area specified by the
height field values. To use this capability, select the scaling option you want as the value of the
See SceneGraph's Texture Memory feature for more information.
Best Practice when using this node
- Avoid loading either very large images (larger than the target screen dimensions), or very small images, with the intent of the firmware scaling to a certain design intention. These can cause an unsatisfactory appearance, or even application issues such as degraded performance.
- For the best appearance and application performance load images either identical to, or close to, the intended target screen dimensions of the Poster node in your application design.
- Set the dimensions of an image in your design by setting the Poster node
If you do not set these fields, designs implemented in certain forms of XML markup may not render as intended, unless you use an explicit callback layout function triggered by the Poster node
loadStatusfield, to render the screen element after the image has loaded and the dimensions are known.
The following example is a poster image placed using Poster node:
When autoscaling between FHD/HD, there may be cases where using images with widths or heights that are not divisible by 2 (i.e. even numbers) do not work correctly.
|uri||string||""||Specifies the URI of the image file. Images included as part of the application package can be referenced using the |
|width||float||0.0||Specifies the width of the image in local coordinates. If set to 0.0, the width of the bitmap from the image file is used. If set to a value greater than 0.0, the bitmap is scaled to that width.|
|height||float||0.0||Specifies the height of the image in local coordinates. If set to 0.0, the height of the bitmap from the image file is used. If set to a value greater than 0.0, the bitmap is scaled to that height.|
|loadSync||Boolean||false||Controls whether the image is loaded synchronously in the render thread, and appears immediately, or loaded asynchronously in a background thread, and may not appear immediately. If set to true, and the |
|Scale the graphical image to the specified width when loaded, preserving aspect ratio. If set to the default, no load-time scaling occurs. If the |
|Scale the graphical image to the specified height when loaded, preserving aspect ratio. If set to the default, no load-time scaling occurs. If the |
Provides automatic scaling of graphical images after loading. If you intend to load very large graphical images, such as larger than the user interface resolution, you must set one of the scaling options other than
After the graphical image file is loaded, contains the width of the graphical image in pixels
After the graphical image file is loaded, contains the height of the graphical image in pixels
This field is set to an associative array with four elements "left", "right", "top" and "bottom". If the Poster's bitmap is a 9-patch image, the associative array is set to margin info encoded along the right and bottom edges of the image. If the Poster's bitmap is not a 9-patch image, all values in the associative array are set to 0. The bitmapMargins field is set whenever the Poster's loadStatus field changes (e.g. when the bitmap has been loaded). Available since firmware version 7.5
|blendColor||color||0xFFFFFFFF||Can be used to tint the image by multiplying the color of each pixel by the specified value. If this value is not set to a value other than the default value, no color blending will be performed.|
|loadingBitmapUri||string||""||Specifies a bitmap file to display while the poster image is loading.|
|loadingBitmapOpacity||float||1.0||Used to control the rendering opacity of the graphical image that indicates a bitmap is loading. This value multiplies the Poster node opacity.|
|failedBitmapUri||string||""||Specifies a bitmap file to display when the poster image failed to load.|
|failedBitmapOpacity||float||1.0||Used to control the rendering opacity of the graphical image that indicates a bitmap failed to load. This value multiplies the Poster node opacity.|
Available since firmware version 7.5
Fields derived from the Group base class can also be used.
The following displays a graphic image from the application images directory near the top left of the display screen.
Rotation of Posters is supported. On platforms that do not support OpenGL, only rotations of 0, 90, 180, and 270 degrees are supported.