日期:2014-05-17  浏览次数:20786 次

asp有没有办法不需要服务器支持就能生成缩略图
好像QQ相册的效果,能在本地编辑好图片才上传到服务器

------解决方案--------------------
先下一个JS函数:
<script language= "javascript ">


function DrawImage(ImgD,width_s,height_s){
/*var width_s=139;
var height_s=104;
*/
var image=new Image();
image.src=ImgD.src;
if(image.width> 0 && image.height> 0){
flag=true;
if(image.width/image.height> =width_s/height_s){
if(image.width> width_s){
ImgD.width=width_s;
ImgD.height=(image.height*width_s)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else{
if(image.height> height_s){
ImgD.height=height_s;
ImgD.width=(image.width*height_s)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
/*else{
ImgD.src= " ";
ImgD.alt= " "
}*/
}
</script>
<script type= "text/JavaScript ">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i <a.length; i++)
if (a[i].indexOf( "# ")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>

调用的时候:
<img src= "images.gif " width=108 height=94 border=0 onload= "DrawImage(this,105,127) ">


105,127可以调整为自己需要尺寸

------解决方案--------------------
写个activex控件
------解决方案--------------------
flash9的as3也可以