cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How do I make the image increase when I click on it?

Hello!
I created the screen as a tutorial. But all the images were too small. I would like the image to increase when you click on it. How can I do this? All images are uploaded using links from the Internet. I will be happy if you help

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you want to change image's size by clicking the image?

Actually, the image's size is decided by its height and width properties.

So you could set a variable by clicking the image and set the image's height, width based on this variable.

I've made a similar test for your reference:
1)set the screen's OnVisible:

Set(var,true)

2)set image's OnSelect:

Set(var,!var)

3)set image's height:

If(var,200,1000)

set image's width:

 

If(var,200,1000)

 

Set the image's image position to Fit.

 

Then at the beginning the image's size is 200*200, if you click the image, the image's size will become 1000*1000, if you click the image again, it will turn back to 200*200.

5124.gif

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @Anonymous ,

The reason why the image only stretch  to the right, but not to the left, is that you do not change the image's X and Y property.

Please notice these two properties' defination:

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

If you want to the image stretch to two sides, you not also need to change the image's height, width value, but also need to change the image's X and Y.

For example:

X:   If(var,350,350-Image3.Width/2)

Y:  If(var,190,190-Image3.Height/2)

 

To sum up ,you need to set the image's X and Y based on the layout that you want.

Here's a doc about how to set app's layout for your reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you want to change image's size by clicking the image?

Actually, the image's size is decided by its height and width properties.

So you could set a variable by clicking the image and set the image's height, width based on this variable.

I've made a similar test for your reference:
1)set the screen's OnVisible:

Set(var,true)

2)set image's OnSelect:

Set(var,!var)

3)set image's height:

If(var,200,1000)

set image's width:

 

If(var,200,1000)

 

Set the image's image position to Fit.

 

Then at the beginning the image's size is 200*200, if you click the image, the image's size will become 1000*1000, if you click the image again, it will turn back to 200*200.

5124.gif

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thank you, but can I do something that would stretch the image not only to the right, but also to the left?

Hi @Anonymous ,

The reason why the image only stretch  to the right, but not to the left, is that you do not change the image's X and Y property.

Please notice these two properties' defination:

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

If you want to the image stretch to two sides, you not also need to change the image's height, width value, but also need to change the image's X and Y.

For example:

X:   If(var,350,350-Image3.Width/2)

Y:  If(var,190,190-Image3.Height/2)

 

To sum up ,you need to set the image's X and Y based on the layout that you want.

Here's a doc about how to set app's layout for your reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-responsive-layout

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,858)