cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with SetAlpha on images?

Plaramee
Associate III

Hi, I am using Touch GFX 4.10.0 on a STM32F769 CPU.

I have been trying to make a fade animation on an image.

I tried on Image widgets as well as ScallableImage widgets. It just does not work.

You can set the alpha at startup in the ViewBase constructor where all the elements get defined, but after that if you try calling it from a View.cpp file at run time, it will not do anything even if you invalidate the widget after changing its alpha value.

I can do it just fine with a TextAera widget but not an image.

So I decided to try something really simple. In Touch GFX designer, I created a new project and added an image. I set an interaction to do a fade animation when the screen gets entered. Well, this does not do anything either, even in the simulator!

I tried to apply the same to a text area and it worked just fine (although it is not very clear what all the parameters do).

So seems to me that the setAlpha function of the image or scallable image is broken.

Unless I am missing an important detail preventing me to do what I want?

Please help me as I really tried everything I could think of.

Thanks in advance!

9 REPLIES 9
Martin KJELDSEN
Chief III

Hi @Philippe Laramée​,

It's not an issue we've seen before or have had reported by users. Let me try to find an STM32F769-DISCO board and see if i can make sense of what you're saying.

Best regards,

Martin

Martin KJELDSEN
Chief III

Hi again,

Works for me on both simulator and stm32f769-disco.

Which version of windows are you running? Can i see your project/code?

Best regards,

Martin

Plaramee
Associate III

Hi Martin,

thank you for your help. It is really appreciated.

I am running on Windows 10.

Also a detail you should know is that I am trying to fade a full screen image (800 x 480). If this can make a difference.

You know, I would rather see the example code you used to try it out. Maybe I'll see something in there that I forgot to add?

Thank you,

Hi. Working fine on the simulator using Windows 7 64B box. Full project is posted here:

https://we.tl/t-BVbKymCTTy

  • not full screen on simulator but with button

and here is another version of the same project that will fade the full screen graphic upon launch (enter screen):

https://we.tl/t-tHDiuu7vka

also working fine on my setup.

Hi @Philippe Laramée​,

I guess you can inspect @Mon2​s project to see, but i did my example using just the designer and a couple of interactions. It shouldn't make a difference if it's a full screen image.

Do you have a background underneath the image? That could be an issue, because we blend the pixels of the image with the pixels directly underneath it and if your image is the only element, there's nothing to blend with.

My guess is you're missing a background.

Plaramee
Associate III

Thank you both for your input. Once I tried your examples and saw that they were working, I questioned myself and tried with a smaller image. It worked. So in the end, my full screen image is just too heavy. Using a smaller image works. So I will optimize my code as it seems something in my project is sucking up CPU time preventing the image to fully render in less than a frame time.

Thanks a lot!

Martin KJELDSEN
Chief III

@Philippe Laramée​, glad you made it work.

But still, you should be able to fade a full screen image in the simulator (if you have a background beneath that image) and it should definitely be possible on an STM32F769.

The project i have right here fades an 800x480 image on a STM32F769 with no problems. It shouldn't be dependent on size.

Can you verify that if you have a background beneath your full screen image that it works as expected?

Yes, I have been able to do it with the simulator yesterday. I don't know why it was not working the day before, probably because I did not have a background behind my image.

If I run a simple project with only my fading image on the STM32F769 Disco board, it works but it is a bit slower than it should be. But on my big project where I have numerous other tasks that run, it does not. I had to use a smaller image for the fading to work.

Like I said, I will try to figure out if some tasks can be optimized (I'm still a the beginning of the project so...) and see if it improves anything.

Thank you,

​Ok, that's great.

It WILL be slower on the STM32F769 than in the simulator because you're constantly updating the entire display (800x480). Same goes for full screen transitions, like Slide. Cover transition will only slow down towards the end (When number of pixels to move increase towards 800x480 it will take more than 1 VSYNC to render a frame)

Best regards,

Martin