Image in DataGrid
This cannot possibly be this difficult, but I cannot figure it out...
I have a DataGrid with a custom ItemRenderer in it. The renderer puts a label above an image, where the label displays the filename of the image.
The cells of my DataGrid are 500x350, with 10px padding all around. My images could be 40x40 or 1024x748 or anything in-between.
I want the images that are smaller than 500x350 to display with no modification, and the images larger than 500x350 to scale (with proper aspect) to fit the area.
I have tried setting height and width on the Image tag, along with scaleMode, fillMode and verticalAlign, but then all of the images get modified (large ones shrink as expected, but small ones are blown up).
If I do not set the scale and fill modes, but do set the height and width, the large images scale down, but leave a huge gap above them so you can barely see them in the cell.
This just cannot be that difficult to do... what am I missing??