在线等待答疑:在ASP的页面初始化如何使图片旋转一定的角度(0-90)度?
用javascript是否可以实现?分数不够可以再加 问题点数:100、回复次数:10Top
1 楼mrshelly(Shelly)回复于 2006-05-04 09:34:17 得分 50
应该说。CSS可以实现。Top
2 楼moodboy1982(老鹰)回复于 2006-05-04 09:38:37 得分 0
可以!Top
3 楼mucel(尽力尽为)回复于 2006-05-04 09:43:18 得分 0
能给一下源代码吗?期待交流Top
4 楼moodboy1982(老鹰)回复于 2006-05-04 09:44:16 得分 10
给一个例子,自己参考吧。
例子太长,无法回复:
可以给我留言,或到:
http://www.esoftnow.com/bbs中给我发贴Top
5 楼mucel(尽力尽为)回复于 2006-05-04 10:05:30 得分 0
楼上给的参考例子在那里?Top
6 楼mrshelly(Shelly)回复于 2006-05-04 10:14:10 得分 0
1楼 meizz (梅花雪) 回复于 2003-04-12 12:50:49 得分 30
<div style="FILTER: progid:DXImageTransform.Microsoft.BasicImage(Rotation=1); height: 1px">
<img src=www.gif></div>
Top
7 楼mrshelly(Shelly)回复于 2006-05-04 10:14:31 得分 10
PS:如果真要很好地控制图片。建议楼主用FLASH。Top
8 楼mucel(尽力尽为)回复于 2006-05-04 10:28:04 得分 0
to mrshelly(Shelly)
你的这种方法Rotation=1, 比如旋转15度或30度要怎么写啊 ?Top
9 楼jobs002(Oh! Office)回复于 2006-05-04 10:31:14 得分 0
<img src="10度的.gif">
<img src="20度的.gif">
gif在图像处理软件处理,比如photoshop,fireworks..................Top
10 楼mrshelly(Shelly)回复于 2006-05-04 10:40:41 得分 30
FROM: 苏昱(dhtmlet at hotmail.com) 样式表滤镜中文手册
<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>
Top




