Hi. I have this function which is really resizing:
<script src="ImageTools.js" type="text/javascript"></script>
<asp:FileUpload ID="imgUpload" runat="server" />
<asp:Image ID="preview" runat="server" />
<script type ="text/javascript" >
document.getElementById('imgUpload').onchange = function(evt) {
ImageTools.resize(this.files[0], {
width: 320, // maximum width
height: 240 // maximum height
}, function(blob, didItResize) {
// didItResize will be true if it managed to resize it, otherwise false (and will return the original file as 'blob')
document.getElementById('preview').src = window.URL.createObjectURL(blob);
// you can also now upload this blob using an XHR.
});
};
</script>
<asp:Button ID="Button1" runat="server" Text="Butt ...
Go to the complete details ...