2020-02-19 12:45 AM
Hello All,
I am using "STM32746G-DISCO" Kit.
I am using the "Image widget" to display the image.
I would like to change the "Image" on fix location on receiving the "CONNECT" & "DISCONNECT" status.
I am using two different Image for CONNECT & DISCONNECT.
Can you please guide me how do i update the image on receiving the "CONNECT" & "DISCONNECT" Status.
I am using following API but when it run, It freeze the GUI.
if(status == 1)
{
image1.setXY(3.76);
Image1.SetBitmap(Bitmap(BITMAP_CONNECTED_ID));
add(Image1);
}
else if(status == 2)
{
image1.setXY(3.76);
Image1.SetBitmap(Bitmap(BITMAP_DISCONNECTED_ID));
add(Image1);
}
please, Do needful for me.
Regards,
Nikunj Patel
2020-02-19 03:46 AM
Hello,
Your image widget should already be added to your screen in the generated code.
When you want to change the image, you invalidate the changed area so that TouchGFX knows that it has to render and redraw this area.
Instead of writing add(Image1), write image1.invalidate()
2020-02-19 05:39 AM
Hello @Alexandre RENOUX
Thanks for guidance, Now it is working for me.
Regards,
Nikunj Patel