cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to change the "Image of Image widget" on receiving the different status

Nikunj Patel
Associate III

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

2 REPLIES 2
Alexandre RENOUX
Principal

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()

Nikunj Patel
Associate III

Hello @Alexandre RENOUX​ 

Thanks for guidance, Now it is working for me.

Regards,

Nikunj Patel