Skip to main content
Nintex Community Menu Bar

Lock image aspect ratio.

  • October 9, 2017
  • 5 replies
  • 33 views

Forum|alt.badge.img+1

I am working in an image library and am having difficulties with the image preview. Most of the files display correctly but large files do not (I only see the top left of the image).  The files need to be kept the sizes they are.  The properties only seem to allow me to modify via a % which distorts the image.  Does anyone know how I can lock the aspect ratio of the image and perhaps limit the frame size it shows in (as I don't want the form to explode in size). I have also tried responsive forms with no luck.

Any advice would be appreciated.

Raquel

5 replies

Forum|alt.badge.img+14
  • Scholar
  • October 9, 2017

can you provide more details on your setup?

do you use image control to display preview?

or kind of trick with calculated value control?

or any other approach?


Forum|alt.badge.img+1
  • Author
  • Rookie
  • October 10, 2017

Hi Marian

Nothing fancy involved, just a straight image control. I have also tried it in a panel with various combinations of ‘resize at runtime’.

Thanks ☺


Forum|alt.badge.img+14
  • Scholar
  • October 10, 2017

try to add CSS style like following into form settings >> custom CSS

.ImgPreview{
   display: block !important;
   max-width:400px  !important;
   max-height:300px !important;
   width: auto !important;
   height: auto !important;
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

and configure class "ImgPreview" for your image control

‌  custom css‌‌ max size‌


Forum|alt.badge.img+1
  • Author
  • Rookie
  • October 10, 2017

Fantastic – thank you! Worked perfectly.


Forum|alt.badge.img+14
  • Scholar
  • October 10, 2017

great!

please mark correct answer.