Skip to main content
AJT
Associate III
October 6, 2020
Solved

[TouchGFX] How to zoom on a Shape

  • October 6, 2020
  • 3 replies
  • 1307 views

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 

This topic has been closed for replies.
Best answer by AJT

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

3 replies

AJT
AJTAuthorBest answer
Associate III
October 7, 2020

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

scottSD
Senior III
October 8, 2020

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.

AJT141
Associate III
October 26, 2020

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