大致是这样的:用Image控件获取了数据库中的图片,图片在数据库中为具体路径,如:http://192.168.0.42/pic/1.jpg。在Page_Load中读取如:this.Image1.ImageUrl = vPath //vPath为路径。怎么样让该图片放大或缩小,鼠标滚动或点击<放大>、<缩小>也可!求代码,谢谢啦!
解决方案 »
- 使用RDLC的疑问(DataTable中有多条数据为什么只显示一页)
- aspx页面中如何获取地址栏中的值?在线等,谢谢了
- HtmlEncode 的问题!!!
- Asp.net项目开发团队,快加入qq群691711....机会难得
- ASP.net 的页面 怎设置居中显示
- 大家谈谈自己的公司靠什么赚钱,给所有有心人一个机会
- access备份@!
- 怪事,有的用户名能登陆,有的又不能登陆,win2003
- SOS:我的ASP应用程序为什么总是调不出来
- 编写的asp.net程式在服务器上显示出乱码.
- 为什么Encrypting的对象无法添加到access数据库中
- 想用网页直接打开像word这样的文件 但是显示是乱码
<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;
} }
}
image.GetThumbnailImage
for (int i = 0; i < dt.Rows.Count; i++)
{
//string vCode = dt.Rows[i]["code"].ToString();
//Response.Write(vCode);
string path = dt.Rows[i]["path"].ToString();
string vPath = path.Replace(";", "");
this.Image1.ImageUrl = vPath + "\r";
}而且是“http://192.168.0.42/pic/1.jpg”这样的形式。我想知道在后台怎么做!
2楼的JS就可以了,自己根据需要改改,因为放大缩小在客户端通过JS来操作就可以了
那么src怎么获得后台从数据库读取的路径。
<img src="<%=picsrc%>" border="1" onmousewheel="return bigImage(this)"/>