0

I'm displaying a variable number of images in a WPF window.

The images have varying widths and heights, but I'm setting the MaxWidth and MaxHeight for each.

I'm currently using a Wrap Panel, but I'm having trouble achieving what I want.

I don't want scrollbars and I want to load only as many images as will fit in the panel without getting cropped.

I've tried to do the math myself, but the images' ActualHeight and ActualWidth are both showing as 0 after I load them.

Any ideas?

  • How do you determine minHeight and minWidth for image? After all you can fit them all if you shrink them enought or do you have a some kind of restriction? – netaholic Sep 09 '15 at 15:01
  • doesn't sound something that you would have to use maths with, share what you need as a pic and what have you done till now – Muds Sep 09 '15 at 15:07
  • I'm trying to show as many pictures as will fit on one page without cropping or scrolling. The pictures are not all the same size. If there are more pictures than will fit on one page, then I will show them one page at a time. I'm using a WrapPanel, and as I add the pictures to the panel one at a time, I need to know when adding one more picture will cause that picture to not be fully visible on the page, so I can stop. I've tried setting a fixed width and height for the pictures, and that worked, but I don't like the excess of empty spaces around the pictures. – user5317523 Sep 11 '15 at 03:22

0 Answers0