410 views
in GUI Development by

Hello,

for our design it is recommended to have an animation of the background image. Since it is not possible to handle a multiframe image of size 800x480 now we try to achieve a similiar effect by changing the opacity of a part of the image of size 800x305. This works very well in the composer, but on the real device each change of the opacity value causes the display to flicker.

I tried to change the opacity, the alpha value of the color, entering the ressource name as AlphaName or FileName. This didn't change the display flickering.

Changing the attribute Buffered to the containng view to true reduces the flickering of the screen, but still there is a black area on the screen for every change of the value:

Is there any way to get a smooth transition of the opacity or alpha value?

BTW: What's the difference on changing opacity or the alpha value? The effect seems to be the same.

1 Answer

0 votes
by
 
Best answer

Hello,

using multi-frame bitmaps is a very convenient approach. The problem in your application case, you want a multi-frame bitmap with fullscreen size 800x480 pixel. In practice, this results in a lot of image information being stored in your target. The feature multi-frame bitmaps is intended for small images, like an animated icon, logo, etc. It is not intended to play full screen videos.

Your approach with animated opacity value sounds good. The reason for the artifacts is difficult to explain. Maybe, you can upload a short video demonstrating the problem? Also, seeing a video could help us to understand which visual effects you intend to achieve with the animation. Knowing this, we can eventually find a better solution.

Generally, the effect of Opacity and the alpha value specified in the Color properties is the same. Opacity is used preferably if you simply want to modulate the opacity of the entire image. With Color properties you can achieve a more sophisticated effect with opacity gradient. If the displayed bitmap has the ALPHA format, it is also usual to specify in the Color properties the values to colorize the ALPHA pixel. Is such case it is common to specify with the colors the corresponding alpha values.

However, if you set both (Opacity and the alpha value in Color) to be less than 255, each value will reduce the resulting opacity of the displayed pixel. The values are accumulated. For example: let's assume you have the alpha value in Color set to 200 and the Opacity set to 64, then the pixel are modulated with the resulting 200 * 64 = 50.

The effect of the attribute Buffered depends on the affected component within your application. Generally, Buffered prevents the affected component from bein redrawn during screen update. In such case, the actual aspect of the component is stored in RAM and used like a bitmap. Thus, Buffered is useful only for components which themselves are not changing their own aspect during the animation. With other words, if the component itself is changing its content with every animation step, the mode Buffered results in RAM wastage only.

Hope it helps you further

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...