Last post Dec 15, 2007 02:15 PM by Mikesdotnetting
Dec 14, 2007 06:09 PM|jpmattis|LINK
Here what I would like to do.
I have a viewgrid that shows information on houses, each row in the viewgrid has an image of the house (width will always be 180, height is variable) and a link to a details page for that house. On the details page there is another image of the same house
but this time it is going to have a width of 250 (height is variable).
What I would like to do is store one image, the one with width of 250, and when the viewgrid loads up it will automatically resize the same image to a width of 180 and the correct height for that width so that the image doesn't look distorted.
For example, if the original image is 250x250, when it is loaded up in the viewgrid I would like it to dynamiclly change to 180x180. Or say if the original image is 250x150, the image when loaded in the viewgrid would have to be 180x108, the height has to
stay proportional to the width. The height will always be variable so I need to be able to put in the correct height so that the image doesn't look distorted.
The images aren't stored in the database, I am actually pulling the image path from the database. For example, the field that I am pulling from the database would have a value like "images/house.jpg".
Does anyone know how to go about doing this?
Dec 15, 2007 03:47 AM|Mikesdotnetting|LINK
Dec 15, 2007 01:26 PM|jpmattis|LINK
Thanks for the reply Mike, that looks like a really good technique, however after reading the post it looks like the thumb loses considerable quality for any images larger then 120x120 pixels..
The images I am going to be using will have a set width of 180px and the height will be variable.
Any ideas how to dynamically resize to those proportions while keeping image quality?
Dec 15, 2007 02:15 PM|Mikesdotnetting|LINK
Try reading the article again, starting with the title of the piece. It offers a method to avoid that.