Resize a image
This code resize a image by a given factor.
AI
KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Quellcode
<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<form name="preview">
<script language = "JavaScript">
function loadImage(pic,imgname,maxwidth,scalefactor){
var h
var w
var scalefactor
var maxwidth
var scalefactor
var theimg
alert(maxwidth + " " + scalefactor)
theimg = new Image();
theimg.src = pic;
h = theimg.height;
w = theimg.width;
if (w > maxwidth){
w = (theimg.width * scalefactor) / theimg.width;
h = (theimg.height * scalefactor) / theimg.width;
}
document.writeln("<img src='" + theimg.src +"' name='" + imgname + "' width='" +w+"' height='" +h+"'>");
}
</script>
<%
img = "Product_Images/MicroStation.jpe"
%>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
loadImage('<%=img%>','imgchange',100,400)
</script>
</form>
</BODY>
</HTML>
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine