我想点击一个"按钮",触发一个事件,传一个参数(角度),使我的图片可以旋转任意角度,如何实现?C#与javascript都可以.
解决方案 »
- 只要在SqlDataSource_Load事件中绑定SelectCommand,会导致GridView更新出错?
- Web Developer 2005如何生成网站?
- 【请教】window.showModalDialog中的treeview点击节点时出现新页面
- 怎么把大量的数据赋给mail.body。显示成类似记录详细列表的格式。
- 如果把内网中 发布系统 生成的静态页面 发送到 外网的一台服务器上,那么,外网服务器上的用户评论信息及论坛帖子数据,如何传回内网中?
- vs2003转到vs2005后中文都变成了乱码
- css中的ID,IE6以上支持,IE6.0有问题。
- ASP.NET批量删除的问题 ····求解
- 如何动态的改变 textbox 的高度或宽度?
- 做程序,一种说不出的痛!
- 急急!页面上有很多值,我想一次都传到下一个页面,还要回传,我该怎么办?
- 问一个关于DataSet的问题
www.wave12.com
支持图片任意角度旋转。
<body>
<OBJECT ID="DAControl"
STYLE="position:absolute; left:0; top:30; width:350; height:300;
z-index: 1"
CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D">
</OBJECT><DIV ID="oDiv" STYLE="WIDTH:250; FILTER:redirect">
<P><IMG SRC="images/srlogo.gif"></P>
</DIV>
<SCRIPT LANGUAGE="JScript">
oLib = DAControl.MeterLibrary;
oFilter = oDiv.filters[0];
oImage = oFilter.elementImage();
DAControl.Image = oImage.Transform(oLib.Rotate2RateDegrees(30)) ;
DAControl.Start();
</SCRIPT>
</body>
<script>
var sFilter="filter : progid:DXImageTransform.Microsoft.Matrix(";
var fM11,fM12,fM21,fM22,fDx,fDy,sType,sMethod;
var oDiv,oCodeDiv,oTxtRotation,oBtnRotation;
var i=0;function rdl_SetRotation(deg) {
var deg2rad=Math.PI*2/360;
rad=deg*deg2rad;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
with (oDiv.filters.item(0)) {
M11=costheta;M12=-sintheta;M21=sintheta;M22=costheta;
}
rdl_UpdateMatrix();
}function rdl_DoAnimation(){
oDiv.onfilterchange=rdl_DoAnimation;
i+=5;
if (i>359) {
i=0;
oDiv.onfilterchange=null;
}
rdl_SetRotation(i);
}function rdl_UpdateMatrix() {
with (oDiv.filters.item(0)) {
fM11=Math.round(M11*10)/10;fM12=Math.round(M12*10)/10;fM21=Math.round(M21*10)/10;fM22=Math.round(M22*10)/10;
fDx=Math.round(Dx*10)/10;fDy=Math.round(Dy*10)/10;sType=FilterType;sMethod=SizingMethod;
}
oCodeDiv.innerText=sFilter+"SizingMethod="+sMethod+",FilterType="+sType+",Dx="+fDx+",Dy="+fDy+",M11="+fM11+",M12="+fM12+",M21="+fM21+",M22="+fM22+");";
}function rdl_Load(e){
oDiv=document.all("idDiv");
oCodeDiv=document.all("idCodeDiv");
oTxtRotation=document.all("idTxtRotation");
oBtnRotation=document.all("idBtnRotation");
var oSelType=document.all("idSelType");
var oSelSize=document.all("idSelSize");
oSelType.onchange=new Function("with (this) oDiv.filters.item(0).filtertype=options(selectedIndex).value;rdl_UpdateMatrix();");
oSelSize.onchange=new Function("with (this) oDiv.filters.item(0).SizingMethod=options(selectedIndex).value;rdl_UpdateMatrix();");
oTxtRotation.onclick=new Function("if (this.value.length>4) this.value=0;");
oBtnRotation.onclick=new Function("rdl_SetRotation(oTxtRotation.value);");
rdl_UpdateMatrix();
}function rdl_DoHFlip(e){
with (oDiv.filters.item(0)) {M11=0-M11;M12=0-M12;}
rdl_UpdateMatrix();
}function rdl_DoVFlip(e){
with (oDiv.filters.item(0)) {M21=0-M21;M22=0-M22;}
rdl_UpdateMatrix();
}window.onload=rdl_Load;
</script>
<div id=idParentDiv><div id=idDiv>
<img src="../images/rdl_body5.jpg" align="right"><h2 >Matrix Filter</h2><b>Written by Rain1977.<br>All rights reserved . Terms of Use .</b>
</div></div><br>
<table><tr>
<td><input type=button value=左右反转 onclick="rdl_DoHFlip();"><input type=button value="上下反转" onclick="rdl_DoVFlip();"></td>
<td ><input id=idTxtRotation type=text value="输入角度数字" size=14></input> <input id=idBtnRotation type=button value="旋转"></td>
<td ><select id=idSelSize><option value="auto expand">auto expand</option><option value="clip to original">clip to original</option></select></td>
<td ><select id=idSelType><option value="bilinear">Bilinear</option><option value="nearest">Nearest Neighbour</option></select></td>
<td><input type=button value="动画" onclick="rdl_DoAnimation();"></td>
</tr></table>
<br>
<div id=idCodeDiv>filter</div>