在网上找了很长时间都没有找到《征服Ajax web 2.0 开发详解》(asp.net)全本 连csdn都是有删选的。希望有的大大可以传本电子档的给我 谢谢!!!非常感谢  源码就不用了,还有个问题我在asp.net的页面中读取到了数据库的数据相对的图片时能显示出来了,但是我怎么能刚好控制图片显示的大小比列呢?弄了很长时间,没法子了,来求救!!!!!

解决方案 »

  1.   

    等比例缩放图片
    <script language="JavaScript">
    var flag=false;
    function DrawImage(ImgD,iwidth,iheight){
      var image=new Image();
      image.src=ImgD.src;
      if(image.width>0 && image.height>0){
      flag=true;
      if(image.width/image.height>= iwidth/iheight){
      if(image.width>iwidth){   
      ImgD.width=iwidth;
      ImgD.height=(image.height*iwidth)/image.width;
      }else{
      ImgD.width=image.width;   
      ImgD.height=image.height;
      }
      ImgD.alt=image.width+"×"+image.height;
      }
      else{
      if(image.height>iheight){   
      ImgD.height=iheight;
      ImgD.width=(image.width*iheight)/image.height;   
      }else{
      ImgD.width=image.width;   
      ImgD.height=image.height;
      }
      ImgD.alt=image.width+"×"+image.height;
      }  }
    }  
    龙腾教程网和下载里看看