cancel
Showing results for 
Search instead for 
Did you mean: 

[TouchGFX] How to zoom on a Shape

AJT
Associate III

Hello,

I'm currently developping on a STM32H7 with TouchGFX library and I'm wondering how to zoom on a shape created with touchgGFX designer ?

The problem is that I'm using setPosition function to increase width and height and to change X and y position but it is not changing the size of my shape but just the zone where we can visualize the shape.

Here is my code : 

shape_HS_bottom_left.invalidate();
 
shape_HS_bottom_left.setPosition(shape_HS_bottom_left.getX() -SHAPE_BLUE_SPREADING_X_OFFSET_RESIDENT_SCREEN/2, shape_HS_bottom_left.getY() -SHAPE_BLUE_SPREADING_Y_OFFSET_RESIDENT_SCREEN/2, 
								shape_HS_bottom_left.getWidth()+SHAPE_BLUE_SPREADING_X_OFFSET_RESIDENT_SCREEN,shape_HS_bottom_left.getHeight()+SHAPE_BLUE_SPREADING_Y_OFFSET_RESIDENT_SCREEN);
 
shape_HS_bottom_left.invalidate();

Any clue ? Do you know the way to zoom on a Shape ? I want the same feature as ZoomAnimationImage type can provide !

Thank you in advance,

Regards,

Ajt 

1 ACCEPTED SOLUTION

Accepted Solutions
AJT
Associate III

Well the solution was to modify each point one by one if someone has the same question

View solution in original post

3 REPLIES 3
AJT
Associate III

Well the solution was to modify each point one by one if someone has the same question

scottSD
Senior III

I believe shape also has a setScale() function which allows you to scale in the x and the y direction independently. You could use that instead of changing every point.

Yes i think you can by changing x and y scales but you must change shape positon if you want it to be centred.

AJT