cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AGS94
Resolver I
Resolver I

Auto-Size Image in Gallery

 

Is there a way to auto-adjust the size of images in a gallery to ensure the full image fits? I am using CDS to store my images. All images are sized at 300 x 300 pixels.

 

The image "envelope" in the gallery below is 128x128 and as can be seen, the images are being cropped. I don't want powerapps dictating the size of the images I save in CDS. It would be far more robust/desirable to have the image "auto-fit" in the gallery.

 

Any thoughts?

 

 

gallery.png

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the detailed response. I am attaching a document that shows all the properties of my image control within a Gallery. The image I am pulling is a user record's image from CDS. The original image is bigger than 300 by 300. Gallery image size is set to 128 by 128. 

 

Also, here is the behaviour I am seeing. Let me know if this looks good:

 

UserImage.gif

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

11 REPLIES 11
v-monli-msft
Community Support
Community Support

Hi @AGS94 ,

 

You can select the image control in the template part of gallery, and set its Size to 300 x 300 pixels.

Capture.JPG

 

Regards,

Mona

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

 

Thanks for the response Mona. Unfortunately 300x300 is way too large for my mobile layout.

 

Again, I know I can go back and re-size everything manually but it is a bit surprising/disappointing that PA does not have a way to auto resize images in a gallery (unless I am missing something somewhere).

Are you saying your images should size based on the device that is being used?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Hi @AGS94 

 

I think I understood what you are asking. Your images are 300 x 300. Your gallery image control is set to 128 x 128. And this is causing your images to get cropped. 

 

Can you tell me what the Image Position property of your image is? See below:

 

GalleryImage.PNG

 

Can you play with that property and set it to may be Fill or Fit?

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

 

 

Hardit,

 

I am saying the image element of the gallery (when loaded from a data source) should work like the standard image control.

 

With the latter, regardless of the image size, it fills the frame as follows:

 

image frame.gif

 

On the other hand, when you are calling an image from a data source (at least when using CDS - I have not checked other data sources),  the image element performs as follows (note the same image file was used on both cases and is 300x300 pixels):

 

gallery image.gif 

 

Hardit,

 

Just saw your second reply. Had previously tried those settings too. Some looked better than others, but none worked as needed.

 

Seems odd that Microsoft has not worked this out and/or that others have not had this issue. Hoping I am missing something, but have no idea what it would be.

Thanks for the detailed response. I am attaching a document that shows all the properties of my image control within a Gallery. The image I am pulling is a user record's image from CDS. The original image is bigger than 300 by 300. Gallery image size is set to 128 by 128. 

 

Also, here is the behaviour I am seeing. Let me know if this looks good:

 

UserImage.gif

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Hello AGS94,

 

I built a quick test App with a CDS custom entity storing images.  It seems the best property setting is "stretch" for the image control within the gallery. "Fill" and "Fit" do work also, but not as smoothly as "stretch".  

 

Mike

 

Image sizing test App with CDS.PNG

 

 

Thanks Hardit. That is what I am looking for. Not sure why mine is not resizing, but I will use your settings and see how it goes. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,524)