Hi all,
I'm having trouble setting up the size of an image in a ListGridField of ListGridFieldType.IMAGE. I can't find a way to preserve image aspect ratio.
In a TileGrid, it works fine. I use the setImageHeight() method to make the height of thumbnails constant, and the images center themselves in the created space, preserving their aspect ratios.
In a ListGrid, the image always seems to stretch to the dimensions that I specify through imageWidth and imageHeight. Unfortunately, in my application, there's no way to know the exact dimensions of the image beforehand.
Thanks in advance for any remarks.
I'm having trouble setting up the size of an image in a ListGridField of ListGridFieldType.IMAGE. I can't find a way to preserve image aspect ratio.
In a TileGrid, it works fine. I use the setImageHeight() method to make the height of thumbnails constant, and the images center themselves in the created space, preserving their aspect ratios.
In a ListGrid, the image always seems to stretch to the dimensions that I specify through imageWidth and imageHeight. Unfortunately, in my application, there's no way to know the exact dimensions of the image beforehand.
Thanks in advance for any remarks.
Comment