ASPは、コンポーネントのないGIF形式検証コードを実装しています。ASP検証コードが必要な友人は、それを参照できます。
<%
オプションexplicit '表示ステートメント
クラスcom_gifcode_class
騒々しい、カウント、幅、高さ、角度、オフセット、境界線
プライベートグラフ()、マージン(3)
private sub class_initialize()
ランダム化
noisy = 16 '干渉点の確率が表示されます
count = 4 '文字量
幅= 80 '画像幅
高さ= 20 '画像の高さ
角度= 2 'ランダム変更を発表しました
オフセット= 20 'オフセットへのランダム変更
Border = 1 'フレームサイズ
End Sub
パブリック関数create()
const ccharset = 123456789
dim i、x、y
dim vvalidcode:vvalidcode =
Dim Vindex
リダイムグラフ(幅1、高さ1)
i = 0の場合-1
vindex = int(rnd * len(ccharset))
vvalidCode = vvalidCode + MID(CCHARSET、videx + 1、1)
SetDraw Vindex、i
次
create = vvalidCode
エンド関数
sub setdot(px、py)
px *(width-px-1)> = 0およびpy *(height-py-1)> = 0の場合、
グラフ(PX、PY)= 1
ifを終了します
End Sub
パブリックサブセットドロー(Pindex、pnumber)
'文字データ
dim dotdata(8)
dotdata(0)= array(30、15、50、1、50、100)
dotdata(1)= array(1、34、30、1、71、1、100、34、1、100、93、100、86)
dotdata(2)= array(1、1、100、1、42、42、100、70、50、100、1、70)
dotdata(3)= array(100、73、6、73、75、6、75、100)
dotdata(4)= array(100、1、1、1、1、50、50、35、55、100、80、50、100、1、95)
dotdata(5)= array(100、20、70、1、20、1、1、30、1、80、30、100、70、100、100、80、100、60、70、50、30、50、50、50、30、50 、1、60)
dotdata(6)= array(6、26、6、6、100、6、53、100)
dotdata(7)= array(100、30、100、20、70、1、30、1、1、20、30、70、80、70、100、30、100、80、80、8、1、70、100 、30)
dotdata(8)= array(1、80、30、100、80、100、100、70、100、20、70、1、30、1、1、20、1、40、30、70、50、70、50 、100、40)
薄暗い:vextent = width / count
マージン(0)= border + vextent *(rnd * offset) / 100 +マージン(1)
マージン(1)= vextent *(pnumber + 1)-border -bextent *(rnd * offset) / 100
マージン(2)=境界 +高さ *(rnd * offset) / 100
マージン(3)=高さ-border -height *(rnd * offset) / 100
Dim Vstartx、Vendx、Vstarty、Vendy
dim vwidth、vdx、vdx、vdy、vdeltat
薄暗いvangle、vlength
vwidth = int(margin(1)-margin(0))
vheight = int(margin(3)-margin(2))
'開始座標
vstartx = int((dotdata(pindex)(0)-1) * vwidth / 100)
vstarty = int
Dim I、J
i = 1からubound(dotdata(pindex)、1)/2の場合
dotdata(pindex)(2*i-2)<> 0およびdotdata(pindex)(2*i)<> 0
'エンドポイント座標
vendx =(dotdata(pindex)(2 * i)-1) * vwidth / 100
Vendy =(dotdata(pindex)(2 * i+1)-1) * vheight / 100
'水平ギャップ
vdx = vendx -vstartx
'垂直ギャップ
vdy = Vendy -vstarty
'チルト角
vdx = 0の場合
vangle = sgn(vdy) * 3.14/2
それ以外
vangle = atn(vdy / vdx)
ifを終了します
'2つの座標距離
sin(vangle)= 0の場合
vlength = vdx
それ以外
vlength = vdy / sin(vangle)
ifを終了します
'ランダム回転角
vangle = vangle +(rnd -0.5) * 2 * angle * 3.14 * 2/100
vdx = int(cos(vangle) * vlength)
vdy = int(sin(vangle) * vlength)
abs(vdx)> abs(vdy)の場合、vdeltat = abs(vdx)else vdeltat = abs(vdy)
j = 1からvdeltatの場合
SetDotマージン(0) + VSTARTX + J * VDX / VDELTAT、マージン(2) + VSTARTY + J * VDELTATAT
次
vstartx = vstartx + vdx
vstarty = vstarty + vdy
ifを終了します
次
End Sub
パブリックサブ出力()
Response.Expires = -9999
Response.Addheader Pragma、No-Cache
Response.Adheader Cache-Clm、No-Cache
Response.ContentType = image/gif
'ファイルタイプ
Response.binarywrite chrb(asc(g))&chrb(asc(i))&chrb(asc(f)))
'バージョン情報
Response.binarywrite chrb(ASC(8))&chrb(ASC(9))&chrb(ASC(a))
'ロジック画面幅
Response.binarywrite chrb(width mod 256)&chrb((width / 256)mod 256)
'ロジック画面の高さ
Response.binarywrite chrb(height mod 256)&chrb(height / 256 mod 256)
Response.binarywrite chrb(128)&chrb(0)&chrb(0)
'グローバルカラーリスト
Response.binarywrite chrb(255)&chrb(255)&chrb(255)
Response.binarywrite chrb(0)&chrb(85)&chrb(255)
'画像識別
Response.binarywrite chrb(asc(,,))
respons.binarywrite chrb(0)&chrb(0)&chrb(0)&chrb(0)
'画像幅
Response.binarywrite chrb(width mod 256)&chrb((width / 256)mod 256)
'イメージハイ
Response.binarywrite chrb(height mod 256)&chrb(height / 256 mod 256)
Response.binarywrite chrb(0)&chrb(7)&chrb(255)
dim x、y、i:i = 0
y = 0から高さ-1
x = 0からwidth -1の場合
rnd <noisy / 100の場合
Response.binarywrite chrb(1-graph(x、y))
それ以外
x *(x-width)= 0またはy *(y-height)= 0の場合、
Response.binaryWrite chrb(グラフ(x、y))
それ以外
グラフ(x-1、y)= 1またはグラフ(x、y)またはグラフ(x、y-1)= 1の場合、
Response.binarywrite chrb(1)
それ以外
respons.binarywrite chrb(0)
ifを終了します
ifを終了します
ifを終了します
if(y * width + x + 1)mod 126 = 0
Response.binarywrite chrb(128)
i = i + 1
ifを終了します
if(y * width + x + i + 1)mod 255 = 0
if(width * height -y * width -x -1)> 255 then then
Response.binarywrite chrb(255)
それ以外
Response.binarywrite chrb(width * height mod 255)
ifを終了します
ifを終了します
次
次
Response.binarywrite chrb(128)&chrb(0)&chrb(129)&chrb(0)&chrb(59)
End Sub
エンドクラス
Dim McOde
set mcode = new com_gifcode_class
session(getCode)= mcode.create()
mcode.output()
MCODE =何も設定しません
%>