2020-10-06 06:40 AM
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
Solved! Go to Solution.
2020-10-07 09:34 AM
Well the solution was to modify each point one by one if someone has the same question
2020-10-07 09:34 AM
Well the solution was to modify each point one by one if someone has the same question
2020-10-08 11:58 AM
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.
2020-10-26 08:27 AM
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