[ASP代码]网页签名小程序

(引用自:http://blog.csdn.net/ljg2597758/services/trackbacks/492206.aspx )


网页签名小程序

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'输出签名表格的宽高
 Dim W,H
 W = 0 : H = 0
 
 strQianMing = "21,73;23,72;28,71;32,70;37,68;42,66;48,64;55,62;61,59;67,56;72,54;76,51;79,49;81,46;83,42;82,39;79,37;76,35;73,33;69,30;66,27;64,25;61,22;59,22;59,30;59,37;60,43;61,50;61,58;62,66;61,74;61,81;60,89;59,95;58,101;58,106;57,110;56,113;55,116;53,114;53,109;52,104;51,99;50,83;50,76;50,68;50,61;50,57;51,55;52,60;52,66;52,73;51,80;51,85;46,97;43,100;41,103;40,106;39,103;40,97;40,97;-1,-1;50,71;53,68;56,67;60,67;64,68;68,70;75,79;77,82;78,86;80,89;80,89;-1,-1;90,13;96,7;99,7;101,8;103,10;104,15;104,19;103,23;101,26;98,29;95,36;89,43;83,49;78,53;68,59;66,60;67,62;70,62;73,61;83,58;88,58;92,57;96,56;99,57;102,57;106,59;109,62;110,65;112,68;114,71;115,75;117,78;118,84;117,91;116,95;112,101;110,104;107,106;103,107;100,108;96,108;92,106;89,104;85,101;82,98;79,82;79,78;80,73;83,70;84,74;82,77;81,80;80,84;79,88;77,90;77,90;-1,-1;98,67;101,65;103,65;105,65;106,69;105,72;100,81;97,86;93,91;89,96;78,105;76,105;76,105;-1,-1;124,40;128,36;131,33;132,31;133,34;133,37;133,41;133,45;132,51;134,53;138,52;140,52;142,50;145,50;147,50;148,53;147,55;146,57;144,60;140,63;137,66;135,68;137,69;141,70;144,71;150,74;152,74;155,75;154,78;149,83;145,86;140,88;136,89;133,90;130,91;128,88;131,81;137,73;137,73;-1,-1;152,60;154,60;156,61;160,62;163,60;166,60;168,59;171,57;174,55;177,54;181,51;181,51;-1,-1;178,32;175,31;173,31;169,37;168,41;168,47;167,52;167,59;167,64;167,69;167,73;168,75;170,78;172,77;174,75;178,68;181,64;183,58;187,54;190,49;194,46;197,43;202,41;205,41;208,46;209,49;209,52;209,55;209,57;208,60;208,60;-1,-1;187,64;186,67;185,69;184,77;184,83;185,86;186,88;187,84;187,84;-1,-1;200,24;203,14;203,12;203,15;201,21;198,28;196,36;194,44;192,49;191,55;190,59;189,61;189,64;189,66;191,68;193,69;196,70;199,69;202,68;205,68;207,67;210,68;213,72;213,74;210,81;209,84;206,86;201,91;199,93;197,95;195,95;191,93;190,89;190,87;196,89;201,91;210,96;217,100;225,102;229,102;229,102;-1,-1"
 IF strQianMing = "" Then Response.write "坐标数据为空!" : Response.end
 '坐标数组
 Dim ZB
 ZB = split(strQianMing,";")

 '数组下标
 Dim lenZB
 lenZB = UBound(ZB)

 确定输出签名表格的宽高
 For i =0 To lenZB
  Dim Twh
  Twh = split(ZB(i),",")
  
  IF Cint(Twh(0)) > Cint(W) Then W = Twh(0)
  IF Cint(Twh(1)) > Cint(H) Then H = Twh(1)
 Next

 Response.write "<table width="& W &" height="& H &" border='1'>"
 Response.write "<tr><td valign=""top"">" 
 Response.write "<span style=""position:relative;overflow:hiden;"">"
 
 Dim xyF,xyS
 Dim x,y 

 For i =0 To lenZB - 1 
  j = i + 1
   IF ZB(i) <> "-1,-1" And ZB(j) <> "-1,-1" Then
    Dim absX,absY
    xyF = split(ZB(i),",") : xyS = split(ZB(j),",")
    absX = Abs(xyS(0) - xyF(0) ) : absY = Abs(xyS(1) - xyF(1))
    IF absX <> 0 Then
     For m = 0 To absX
      IF Cint(xyS(0)) >= Cint(xyF(0)) Then
       x = Cint(xyF(0)) + m
      Else
       x = Cint(xyF(0)) - m
      End IF

      Dim BS
       BS = Cint(absY/absX)
       
      For k = 0 To BS
       IF Cint(xyS(1)) >= Cint(xyF(1)) Then
        y = Cint(xyF(1)) + Cint((absY/absX)*m + k - BS)
       Else
        y = Cint(xyF(1)) - Cint((absY/absX)*m + k - BS)
       End IF   
       Response.write "<div style=""position:absolute;left:"& x &";top:"& y &";height:2;width:2;font-size:1px;background-color:blue""></div>"
      Next
     Next
    Else
     For m = 0 To absY
      x = Cint(xyF(0)) : y = Cint(xyF(1)) + m
      Response.write "<div style=""position:absolute;left:"& x &";top:"& y &";height:2;width:2;font-size:1px;background-color:blue""></div>"
     Next
    End IF
   ElseIF ZB(i) = "-1,-1" And ZB(j) <> "-1,-1" And j = lenZB Then
    xyF = split(ZB(i),",")
    x = Cint(xyF(0)) : y = Cint(xyF(1))
    Response.write x &"," & y &" <br>"
    Response.write "<div style=""position:absolute;left:"& x &";top:"& y &";height:2;width:2;font-size:1px;background-color:blue""></div>"    
   End IF
 Next

 Response.write "</span>"
 Response.write "</td></tr>"
 Response.write "</table>"
%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值