Image Sizing

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Image Sizing

Post by soa »

Welcome back.

I have a photo displayed on a vlweb panel .The user has asked for it to be larger. It is in a column layout. The column is 225px wide and the image is set to FitToWidth. Image Sizing is BestFit. The image always stays exactly as the physical size - 175px - and leaves a gap to the right, If I set the image sizing to Fitboth I can make it bigger but I get distortion. How do Make the image larger without losing the aspect ratio?
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Image Sizing

Post by jyoung »

If you have a small image (175px) that you are trying to make bigger (225px) I believe you will always get some distortion as you are "stretching" the image to fit, unless you have a vector graphic.

You may be able to resize it manually with something like paint.net.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Image Sizing

Post by soa »

It should be possible to resize an image by manipulating only one dimension and the system calculating the other. This is normal web behavior and what BestFit is supposed to do.

Manually resizing each image is not an option as these are user uploaded identity photos which are used in other contexts.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Image Sizing - SOLVED

Post by soa »

I added a panel and sized it to fit both on the layout and then I added the image on top of the panel and made the image bestfit and align top left and now I'm getting resizing behavior.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Image Sizing

Post by Stewart Marshall »

When using BestFit, the image size will resize so that it fits within the available space. This means it's size is governed by whichever is the smaller of Height and Width.

If you have an image control that is 175 high and FitTtoWidth, the width can change to 1000 but the image itself will only display as 175 because the height never changes. For the image to show at 225, the image control must be at least 225x225.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply