ColdFusion - How to resize image height width programmatically

cfimage - change image height width programmatically

cfimageActionResize.cfm


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfimage action resize: how to change image height width programmatically</title>
</head>

<body>
<h2 style="color:SeaGreen; font-style:italic">cfimage tag example: how to resize image</h2>
<hr width="525" align="left" color="DarkSeaGreen" />
<br />

<cfimage source="Images/Dog3.jpg" action="resize" name="ResizedImage" height="150" width="200">


<table border="1" cellpadding="5" cellspacing="0" bordercolor="DarkSeaGreen">
    <tr bgcolor="SeaGreen" style="color:Snow; font-size:large" align="center">
        <td>
            Image Preview
        </td>
        <td>
            Image after resize
        </td>
    </tr>
    <tr height="100" valign="top">
        <td style="color:RosyBrown; font-weight:bold">
   <img src="Images/Dog3.jpg" height="300" width="400"/>
        </td>
        <td>
   <cfimage action="writetobrowser" source="#ResizedImage#">
        </td>
    </tr>
</table>

</body>
</html>







More ColdFusion examples