灵魂腐蚀 发表于 2015-1-16 22:20:41

ASP网页编程之ASP不必要组件天生图片考证码的办法

楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。考证码创建font.asp文件
<%
DimFont
DimLetter(30)
SetFont=Server.CreateObject("Scripting.Dictionary")
Letter(0)="00000000000000"
Letter(1)="00000000000000"
Letter(2)="00000000000000"
Letter(3)="00000000000000"
Letter(4)="00000000000000"
Letter(5)="00000000000000"
Letter(6)="00000000000000"
Letter(7)="00000000000000"
Letter(8)="00011000000000"
Letter(9)="00011110000000"
Letter(10)="00001111000000"
Letter(11)="00011111000000"
Letter(12)="00011011100000"
Letter(13)="00111001100000"
Letter(14)="00110001111111"
Letter(15)="00111111111110"
Letter(16)="11111111110000"
Letter(17)="11100000110000"
Letter(18)="01100000110000"
Letter(19)="01100000110000"
Letter(20)="01100000110000"
Letter(21)="01100000010000"
Letter(22)="00000000000000"
Letter(23)="00000000000000"
Letter(24)="00000000000000"
Letter(25)="00000000000000"
Letter(26)="00000000000000"
Letter(27)="00000000000000"
Letter(28)="00000000000000"
Letter(29)="00000000000000"
Font.Add"A",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0000000000000"
Letter(9)="1100000000000"
Letter(10)="1100111100000"
Letter(11)="0111111111000"
Letter(12)="1111000011000"
Letter(13)="1110000011000"
Letter(14)="0011000111000"
Letter(15)="0011111110000"
Letter(16)="0111111111100"
Letter(17)="0111111111111"
Letter(18)="0111000000011"
Letter(19)="0111000000011"
Letter(20)="0111100000111"
Letter(21)="0111111111110"
Letter(22)="0110011111000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"B",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="00001111100"
Letter(10)="00111111100"
Letter(11)="01110000000"
Letter(12)="11100000000"
Letter(13)="11000000000"
Letter(14)="11000000000"
Letter(15)="11000000000"
Letter(16)="11000000000"
Letter(17)="11000000000"
Letter(18)="11000000000"
Letter(19)="01100000011"
Letter(20)="01110000110"
Letter(21)="00111111110"
Letter(22)="00011111000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"C",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0110000000000"
Letter(9)="0110000000000"
Letter(10)="0111111100000"
Letter(11)="1111111111000"
Letter(12)="1111000011100"
Letter(13)="0011000001100"
Letter(14)="0011000000110"
Letter(15)="0011000000110"
Letter(16)="0011000000110"
Letter(17)="0011000000110"
Letter(18)="0011000000110"
Letter(19)="0111000011100"
Letter(20)="0111111111000"
Letter(21)="0111111110000"
Letter(22)="0110000000000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"D",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="11000000000"
Letter(10)="11100000000"
Letter(11)="01111111110"
Letter(12)="11111111100"
Letter(13)="11110000000"
Letter(14)="00110000000"
Letter(15)="00110000000"
Letter(16)="00111111100"
Letter(17)="00111111100"
Letter(18)="00110000000"
Letter(19)="11110000000"
Letter(20)="11111111110"
Letter(21)="01111111110"
Letter(22)="01100000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"E",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="01100111110"
Letter(10)="01111111111"
Letter(11)="01111000011"
Letter(12)="11100000000"
Letter(13)="11100000000"
Letter(14)="00100000000"
Letter(15)="00100000000"
Letter(16)="00111111000"
Letter(17)="00111111000"
Letter(18)="00111000000"
Letter(19)="00110000000"
Letter(20)="00110000000"
Letter(21)="00110000000"
Letter(22)="00110000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"F",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0000000000000"
Letter(9)="0011000000000"
Letter(10)="0011111111000"
Letter(11)="0111111111000"
Letter(12)="1110000000000"
Letter(13)="1110000000000"
Letter(14)="0110000000000"
Letter(15)="0110000011000"
Letter(16)="0110001111111"
Letter(17)="0110001111110"
Letter(18)="0110000011000"
Letter(19)="0110000011000"
Letter(20)="0111111111000"
Letter(21)="0111111111000"
Letter(22)="0011000011000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"G",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000100"
Letter(9)="01100001100"
Letter(10)="01100001100"
Letter(11)="01100001100"
Letter(12)="01110001100"
Letter(13)="00110011000"
Letter(14)="00110011000"
Letter(15)="00111111000"
Letter(16)="00111111000"
Letter(17)="00110011000"
Letter(18)="00110011000"
Letter(19)="00110001100"
Letter(20)="00110001110"
Letter(21)="01110000110"
Letter(22)="01100000010"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"H",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000110000"
Letter(10)="0110110110"
Letter(11)="0111111110"
Letter(12)="0001111000"
Letter(13)="0001110000"
Letter(14)="0001100000"
Letter(15)="0001100000"
Letter(16)="0001100000"
Letter(17)="0001100000"
Letter(18)="0001100000"
Letter(19)="0001100000"
Letter(20)="0111111000"
Letter(21)="1111111110"
Letter(22)="1100000100"
Letter(23)="0000000000"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"I",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0000000110000"
Letter(9)="0000111111110"
Letter(10)="0000111111110"
Letter(11)="0000000011000"
Letter(12)="0000000011000"
Letter(13)="0000000011000"
Letter(14)="0000000011000"
Letter(15)="1111100011000"
Letter(16)="1111110011000"
Letter(17)="0011000011000"
Letter(18)="0011000011000"
Letter(19)="0011000111000"
Letter(20)="0001100110000"
Letter(21)="0001111110000"
Letter(22)="0000111100000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"J",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="01100000100"
Letter(10)="01100000110"
Letter(11)="01100000110"
Letter(12)="01100000110"
Letter(13)="01100000110"
Letter(14)="01100000110"
Letter(15)="11111100110"
Letter(16)="11111111110"
Letter(17)="00110011100"
Letter(18)="00110111110"
Letter(19)="00110000110"
Letter(20)="01110000110"
Letter(21)="01100000110"
Letter(22)="00000000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"K",Letter
Letter(0)="000000000000"
Letter(1)="000000000000"
Letter(2)="000000000000"
Letter(3)="000000000000"
Letter(4)="000000000000"
Letter(5)="000000000000"
Letter(6)="000000000000"
Letter(7)="000000000000"
Letter(8)="011000000000"
Letter(9)="011000000000"
Letter(10)="011000000000"
Letter(11)="011000000000"
Letter(12)="011100000000"
Letter(13)="001100000000"
Letter(14)="001100000000"
Letter(15)="001100000000"
Letter(16)="001100000000"
Letter(17)="001100000000"
Letter(18)="111100000000"
Letter(19)="111110000000"
Letter(20)="011111111110"
Letter(21)="011111111100"
Letter(22)="011000000000"
Letter(23)="000000000000"
Letter(24)="000000000000"
Letter(25)="000000000000"
Letter(26)="000000000000"
Letter(27)="000000000000"
Letter(28)="000000000000"
Letter(29)="000000000000"
Font.Add"L",Letter
Letter(0)="00000000000000"
Letter(1)="00000000000000"
Letter(2)="00000000000000"
Letter(3)="00000000000000"
Letter(4)="00000000000000"
Letter(5)="00000000000000"
Letter(6)="00000000000000"
Letter(7)="00000000000000"
Letter(8)="00000000000000"
Letter(9)="01100000000000"
Letter(10)="01100000110000"
Letter(11)="11111000110000"
Letter(12)="11111100111110"
Letter(13)="01101111111110"
Letter(14)="01100111011000"
Letter(15)="01100110011000"
Letter(16)="01100000011000"
Letter(17)="01100000011000"
Letter(18)="01100000011000"
Letter(19)="01100000011000"
Letter(20)="01100000010000"
Letter(21)="01100000110000"
Letter(22)="00000000100000"
Letter(23)="00000000000000"
Letter(24)="00000000000000"
Letter(25)="00000000000000"
Letter(26)="00000000000000"
Letter(27)="00000000000000"
Letter(28)="00000000000000"
Letter(29)="00000000000000"
Font.Add"M",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="000001100"
Letter(10)="110001100"
Letter(11)="111000110"
Letter(12)="111000110"
Letter(13)="111100110"
Letter(14)="111100110"
Letter(15)="111100110"
Letter(16)="110110110"
Letter(17)="110110110"
Letter(18)="110111100"
Letter(19)="110111100"
Letter(20)="110011100"
Letter(21)="110011000"
Letter(22)="000011000"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"N",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000000000"
Letter(10)="0000011000"
Letter(11)="0001111100"
Letter(12)="0110001110"
Letter(13)="0100000110"
Letter(14)="1100000011"
Letter(15)="1100000011"
Letter(16)="1100000011"
Letter(17)="1100000011"
Letter(18)="1110000011"
Letter(19)="0110000011"
Letter(20)="0011100110"
Letter(21)="0011111110"
Letter(22)="0000111100"
Letter(23)="0000000000"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"O",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="011000000"
Letter(10)="011111110"
Letter(11)="111111110"
Letter(12)="111000011"
Letter(13)="001100011"
Letter(14)="001100011"
Letter(15)="011100111"
Letter(16)="011111110"
Letter(17)="001111000"
Letter(18)="001100000"
Letter(19)="001100000"
Letter(20)="011100000"
Letter(21)="011000000"
Letter(22)="000000000"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"P",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000000000"
Letter(10)="0001111000"
Letter(11)="0111111100"
Letter(12)="0111001110"
Letter(13)="1100000110"
Letter(14)="1100000011"
Letter(15)="1100000011"
Letter(16)="1100000011"
Letter(17)="1100011011"
Letter(18)="0110011011"
Letter(19)="0111001111"
Letter(20)="0011111110"
Letter(21)="0001111110"
Letter(22)="0000000110"
Letter(23)="0000000010"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"Q",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="01100000000"
Letter(10)="01100000000"
Letter(11)="01111111100"
Letter(12)="11111111110"
Letter(13)="11110000110"
Letter(14)="00110000110"
Letter(15)="00110011110"
Letter(16)="00111111100"
Letter(17)="01111100000"
Letter(18)="01111110000"
Letter(19)="00011111100"
Letter(20)="00110011110"
Letter(21)="00110000110"
Letter(22)="00100000110"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"R",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="000000000"
Letter(10)="001110000"
Letter(11)="011111000"
Letter(12)="111011000"
Letter(13)="110011000"
Letter(14)="110001110"
Letter(15)="111111111"
Letter(16)="011110011"
Letter(17)="010000011"
Letter(18)="110000011"
Letter(19)="110000011"
Letter(20)="111000111"
Letter(21)="011111110"
Letter(22)="000111100"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"S",Letter
Letter(0)="000000000000"
Letter(1)="000000000000"
Letter(2)="000000000000"
Letter(3)="000000000000"
Letter(4)="000000000000"
Letter(5)="000000000000"
Letter(6)="000000000000"
Letter(7)="000000000000"
Letter(8)="000000000000"
Letter(9)="000000000000"
Letter(10)="000000000000"
Letter(11)="000000000000"
Letter(12)="011111111111"
Letter(13)="111111111111"
Letter(14)="110001100000"
Letter(15)="000001100000"
Letter(16)="000001100000"
Letter(17)="000001100000"
Letter(18)="000001100000"
Letter(19)="000001100000"
Letter(20)="000001100000"
Letter(21)="000001100000"
Letter(22)="000000000000"
Letter(23)="000000000000"
Letter(24)="000000000000"
Letter(25)="000000000000"
Letter(26)="000000000000"
Letter(27)="000000000000"
Letter(28)="000000000000"
Letter(29)="000000000000"
Font.Add"T",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="00000001100"
Letter(10)="00110001100"
Letter(11)="00110001100"
Letter(12)="00110001100"
Letter(13)="01100011000"
Letter(14)="01100011000"
Letter(15)="01100011000"
Letter(16)="01100011000"
Letter(17)="01100011000"
Letter(18)="01100011000"
Letter(19)="00111111100"
Letter(20)="11111111100"
Letter(21)="11111001110"
Letter(22)="00000000110"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"U",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000000000"
Letter(10)="1100000010"
Letter(11)="1100000110"
Letter(12)="0110001110"
Letter(13)="0110011100"
Letter(14)="0110011000"
Letter(15)="0011111000"
Letter(16)="0011110000"
Letter(17)="0011110000"
Letter(18)="0011110000"
Letter(19)="0011100000"
Letter(20)="0011100000"
Letter(21)="0111100000"
Letter(22)="0110000000"
Letter(23)="0000000000"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"V",Letter
Letter(0)="00000000000000"
Letter(1)="00000000000000"
Letter(2)="00000000000000"
Letter(3)="00000000000000"
Letter(4)="00000000000000"
Letter(5)="00000000000000"
Letter(6)="00000000000000"
Letter(7)="00000000000000"
Letter(8)="00000000000000"
Letter(9)="00000000000111"
Letter(10)="00000000001111"
Letter(11)="11000000001100"
Letter(12)="11000000001100"
Letter(13)="01100000001100"
Letter(14)="01110000011100"
Letter(15)="00110000011000"
Letter(16)="00110010011000"
Letter(17)="00110111011000"
Letter(18)="00011111011000"
Letter(19)="00011111111000"
Letter(20)="00011101111000"
Letter(21)="00011100111000"
Letter(22)="00011000010000"
Letter(23)="00000000000000"
Letter(24)="00000000000000"
Letter(25)="00000000000000"
Letter(26)="00000000000000"
Letter(27)="00000000000000"
Letter(28)="00000000000000"
Letter(29)="00000000000000"
Font.Add"W",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="00000000000"
Letter(10)="01000000000"
Letter(11)="01110001110"
Letter(12)="00110111110"
Letter(13)="00011110000"
Letter(14)="00011100000"
Letter(15)="00011100000"
Letter(16)="00011110000"
Letter(17)="00111110000"
Letter(18)="00110011000"
Letter(19)="01100011100"
Letter(20)="01100001100"
Letter(21)="11000001100"
Letter(22)="11000000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"X",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0000000000000"
Letter(9)="0000000000110"
Letter(10)="1100000001110"
Letter(11)="1100000011100"
Letter(12)="1100000011000"
Letter(13)="1100000110000"
Letter(14)="1111111110000"
Letter(15)="0111111110000"
Letter(16)="0000110111000"
Letter(17)="0000011011000"
Letter(18)="0000011000000"
Letter(19)="0000011000000"
Letter(20)="0000011000000"
Letter(21)="0000011000000"
Letter(22)="0000010000000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"Y",Letter
Letter(0)="0000000000000"
Letter(1)="0000000000000"
Letter(2)="0000000000000"
Letter(3)="0000000000000"
Letter(4)="0000000000000"
Letter(5)="0000000000000"
Letter(6)="0000000000000"
Letter(7)="0000000000000"
Letter(8)="0000000000000"
Letter(9)="0000000000000"
Letter(10)="0111111110000"
Letter(11)="0111111110000"
Letter(12)="0000001100000"
Letter(13)="0000011000000"
Letter(14)="0000110000000"
Letter(15)="0001110000000"
Letter(16)="0011100000000"
Letter(17)="0011000000000"
Letter(18)="0110000000000"
Letter(19)="1110000000000"
Letter(20)="1100000000110"
Letter(21)="1111111111110"
Letter(22)="0111111111000"
Letter(23)="0000000000000"
Letter(24)="0000000000000"
Letter(25)="0000000000000"
Letter(26)="0000000000000"
Letter(27)="0000000000000"
Letter(28)="0000000000000"
Letter(29)="0000000000000"
Font.Add"Z",Letter
Letter(0)="000000000000"
Letter(1)="000000000000"
Letter(2)="000000000000"
Letter(3)="000000000000"
Letter(4)="000000000000"
Letter(5)="000000000000"
Letter(6)="000000000000"
Letter(7)="000000000000"
Letter(8)="000000000000"
Letter(9)="000000000000"
Letter(10)="001111110000"
Letter(11)="011111111100"
Letter(12)="110000011110"
Letter(13)="110000000110"
Letter(14)="110000000011"
Letter(15)="110000000011"
Letter(16)="110000000011"
Letter(17)="110000000011"
Letter(18)="110000000110"
Letter(19)="011000011100"
Letter(20)="011111111000"
Letter(21)="000111000000"
Letter(22)="000000000000"
Letter(23)="000000000000"
Letter(24)="000000000000"
Letter(25)="000000000000"
Letter(26)="000000000000"
Letter(27)="000000000000"
Letter(28)="000000000000"
Letter(29)="000000000000"
Font.Add"0",Letter
Letter(0)="00000"
Letter(1)="00000"
Letter(2)="00000"
Letter(3)="00000"
Letter(4)="00000"
Letter(5)="00000"
Letter(6)="00000"
Letter(7)="00000"
Letter(8)="00000"
Letter(9)="00000"
Letter(10)="00111"
Letter(11)="01111"
Letter(12)="11111"
Letter(13)="11110"
Letter(14)="00110"
Letter(15)="00110"
Letter(16)="01100"
Letter(17)="01100"
Letter(18)="11000"
Letter(19)="11000"
Letter(20)="11000"
Letter(21)="11000"
Letter(22)="00000"
Letter(23)="00000"
Letter(24)="00000"
Letter(25)="00000"
Letter(26)="00000"
Letter(27)="00000"
Letter(28)="00000"
Letter(29)="00000"
Font.Add"1",Letter
Letter(0)="0000000"
Letter(1)="0000000"
Letter(2)="0000000"
Letter(3)="0000000"
Letter(4)="0000000"
Letter(5)="0000000"
Letter(6)="0000000"
Letter(7)="0000000"
Letter(8)="0000000"
Letter(9)="0111100"
Letter(10)="1111110"
Letter(11)="1100110"
Letter(12)="1100110"
Letter(13)="1100110"
Letter(14)="0000110"
Letter(15)="0000110"
Letter(16)="0000110"
Letter(17)="0111110"
Letter(18)="1111110"
Letter(19)="1101110"
Letter(20)="1101110"
Letter(21)="0111111"
Letter(22)="0000010"
Letter(23)="0000000"
Letter(24)="0000000"
Letter(25)="0000000"
Letter(26)="0000000"
Letter(27)="0000000"
Letter(28)="0000000"
Letter(29)="0000000"
Font.Add"2",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="01111100000"
Letter(10)="11111100000"
Letter(11)="00001100000"
Letter(12)="00001100000"
Letter(13)="00011111100"
Letter(14)="11111111110"
Letter(15)="11100000110"
Letter(16)="00000000110"
Letter(17)="00000000110"
Letter(18)="00000000110"
Letter(19)="00000000110"
Letter(20)="00000011100"
Letter(21)="00111111100"
Letter(22)="00111110000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"3",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="00000000000"
Letter(9)="01100000000"
Letter(10)="01100000000"
Letter(11)="01100000000"
Letter(12)="01100000110"
Letter(13)="01100000110"
Letter(14)="01100001110"
Letter(15)="01100001100"
Letter(16)="11111111110"
Letter(17)="11111111110"
Letter(18)="00000011000"
Letter(19)="00000011000"
Letter(20)="00000011000"
Letter(21)="00000011000"
Letter(22)="00000000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"4",Letter
Letter(0)="00000000000"
Letter(1)="00000000000"
Letter(2)="00000000000"
Letter(3)="00000000000"
Letter(4)="00000000000"
Letter(5)="00000000000"
Letter(6)="00000000000"
Letter(7)="00000000000"
Letter(8)="01100000000"
Letter(9)="01100000000"
Letter(10)="11111111111"
Letter(11)="01111111111"
Letter(12)="01100000000"
Letter(13)="01100000000"
Letter(14)="01111111110"
Letter(15)="01111111111"
Letter(16)="01110000011"
Letter(17)="00000000011"
Letter(18)="00000000011"
Letter(19)="00000000111"
Letter(20)="11111111110"
Letter(21)="11111111000"
Letter(22)="00000000000"
Letter(23)="00000000000"
Letter(24)="00000000000"
Letter(25)="00000000000"
Letter(26)="00000000000"
Letter(27)="00000000000"
Letter(28)="00000000000"
Letter(29)="00000000000"
Font.Add"5",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000000000"
Letter(10)="0001110000"
Letter(11)="0011111000"
Letter(12)="0011110000"
Letter(13)="0111001110"
Letter(14)="0110111111"
Letter(15)="0111111011"
Letter(16)="1111100011"
Letter(17)="1111000011"
Letter(18)="1110000111"
Letter(19)="1100000110"
Letter(20)="1100001110"
Letter(21)="1111111100"
Letter(22)="0011110000"
Letter(23)="0000000000"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"6",Letter
Letter(0)="0000000000"
Letter(1)="0000000000"
Letter(2)="0000000000"
Letter(3)="0000000000"
Letter(4)="0000000000"
Letter(5)="0000000000"
Letter(6)="0000000000"
Letter(7)="0000000000"
Letter(8)="0000000000"
Letter(9)="0000000000"
Letter(10)="1111111110"
Letter(11)="1111111110"
Letter(12)="0000001110"
Letter(13)="0000001100"
Letter(14)="0000011000"
Letter(15)="0000111000"
Letter(16)="0111111000"
Letter(17)="0111111100"
Letter(18)="0011000000"
Letter(19)="0110000000"
Letter(20)="0110000000"
Letter(21)="0110000000"
Letter(22)="0000000000"
Letter(23)="0000000000"
Letter(24)="0000000000"
Letter(25)="0000000000"
Letter(26)="0000000000"
Letter(27)="0000000000"
Letter(28)="0000000000"
Letter(29)="0000000000"
Font.Add"7",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="000111100"
Letter(10)="000111110"
Letter(11)="001100110"
Letter(12)="001100110"
Letter(13)="011111100"
Letter(14)="110001110"
Letter(15)="110000110"
Letter(16)="110000110"
Letter(17)="110000110"
Letter(18)="110000110"
Letter(19)="110001100"
Letter(20)="011011100"
Letter(21)="011111000"
Letter(22)="001110000"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"8",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="000000000"
Letter(10)="001111100"
Letter(11)="011111110"
Letter(12)="111000110"
Letter(13)="110000110"
Letter(14)="110001110"
Letter(15)="110001110"
Letter(16)="111111110"
Letter(17)="011110110"
Letter(18)="000001100"
Letter(19)="000001100"
Letter(20)="000111000"
Letter(21)="000110000"
Letter(22)="000000000"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"9",Letter
Letter(0)="000000000"
Letter(1)="000000000"
Letter(2)="000000000"
Letter(3)="000000000"
Letter(4)="000000000"
Letter(5)="000000000"
Letter(6)="000000000"
Letter(7)="000000000"
Letter(8)="000000000"
Letter(9)="000000000"
Letter(10)="000000000"
Letter(11)="000000000"
Letter(12)="000000000"
Letter(13)="000000000"
Letter(14)="000000000"
Letter(15)="000000000"
Letter(16)="000000000"
Letter(17)="000000000"
Letter(18)="000000000"
Letter(19)="000000000"
Letter(20)="000000000"
Letter(21)="000000000"
Letter(22)="000000000"
Letter(23)="000000000"
Letter(24)="000000000"
Letter(25)="000000000"
Letter(26)="000000000"
Letter(27)="000000000"
Letter(28)="000000000"
Letter(29)="000000000"
Font.Add"",Letter
%>
创建canvas.asp文件
<%
Constantsforthisclass
publicconstMAX_WIDTH=65535
publicconstMAX_HEIGHT=65535
publicconstINIT_WIDTH=20
publicconstINIT_HEIGHT=20
publicconstFLAG_DEBUG=false
publicconstCURRENT_VER="01.00.05"
publicconstPI=3.14159265Roughly
ClassCanvas
Publicdata
publicGlobalColourTable()
publicLocalColourTable()
publicForegroundColourIndexCurrentforegroundpen
publicBackgroundColourIndexCurrentbackgroundpen
publicTransparentColourIndexCurrenttransparencycolourindex
publicUseTransparencyBooleanforwritingtransparency
publicGIF89aWriteGIF89adata
publicCommentImagecomment255charactersmax

Privatedata
privatesImage
privatelWidth
privatelHeight
privateiBits
privatelColourResolution
privatebSortFlag
privatebytePixelAspectRatio
privatebyteSeperator
privatebyteGraphicControl
privatebyteEndOfImage
privatelLeftPosition
privatelTopPosition
privatelLocalColourTableSize
privatelGlobalColourTableSize
privatelReserved
privatebInterlaceFlag
privatebLocalColourTableFlag
privatebGlobalColourTableFlag
privatelCodeSize
privatebTest

***************************************************************************
************************Rastermanagementfunctions**********************
***************************************************************************
publicpropertygetVersion()
Version=CURRENT_VER
endproperty
Getaspecificpixelcolour
publicpropertygetPixel(ByVallX,ByVallY)
iflX<=lWidthandlX>0andlY<=lHeightandlY>0then
Pixel=AscB(MidB(sImage,(lWidth*(lY-1))+lX,1))
elseOutofbounds,returnzero
Pixel=0
endif
endproperty

Setaspecificpixelcolour,lookatspeedingthisupsomehow...
publicpropertyletPixel(ByVallX,ByVallY,lValue)
DimsTemp
DimlOffset

lX=int(lX)
lY=int(lY)
lValue=int(lValue)
lOffset=lWidth*(lY-1)
iflX<=lWidthandlY<=lHeightandlX>0andlY>0thenClipping
Setthepixelvalueatthispoint
sImage=LeftB(sImage,lOffset+(lX-1))&ChrB(lValue)&RightB(sImage,LenB(sImage)-(lOffset+lX))
endif
endproperty
Readonlywidthandheight,tochangethese,resizetheimage
publicpropertygetWidth()
Width=lWidth
endproperty
publicpropertygetHeight()
Height=lHeight
endproperty
publicsubReplace(ByVallOldColour,ByVallNewColour)
DimlTempX
DimlTempY

forlTempy=1tolHeight
forlTempX=1tolWidth
ifPixel(lTempX,lTempY)=lOldColourthen
Pixel(lTempX,lTempY)=lNewColour
endif
next
next
endsub
Copyasectionofthepicturefromonelocationtotheother
publicsubCopy(ByVallX1,ByVallY1,ByVallX2,ByVallY2,ByVallX3,ByVallY3)
DimsCopy
DimlTemp1
DimlTemp2
DimlStartX
DimlStartY
DimlFinishX
DimlFinishY
DimlWidth
DimlHeight

iflX1>lX2then
lStartX=lX2
lFinishX=lX1
else
lStartX=lX1
lFinishX=lX2
endif

iflY1>lY2then
lStartY=lY2
lFinishY=lY1
else
lStartY=lY1
lFinishY=lY2
endif

sCopy=""

lWidth=lFinishX-lStartX+1
lHeight=lFinishY-lStartY+1
foriTemp2=lStartYtolFinishY
foriTemp1=lStartXtolFinishX
sCopy=sCopy&ChrB(Pixel(iTemp1,iTemp2))
next
next

foriTemp2=1tolHeight
foriTemp1=1tolWidth
Pixel(lX3+iTemp1,lY3+iTemp2)=AscB(MidB(sCopy,(iTemp2-1)*lWidth+iTemp1,1))
next
next
endsub
Non-recursivefloodfill,VBScripthasashortstack(200bytes)sorecursionwontwork
publicsubFlood(ByVallX,ByVallY)
DimaPixelStack
DimobjPixel
DimlOldPixel
SetaPixelStack=NewPixelStack

aPixelStack.PushlX,lY

lOldPixel=Pixel(lX,lY)

while(aPixelStack.Size>0)
SetobjPixel=aPixelStack.Pop

ifobjPixel.X>=1andobjPixel.X<=lWidthandobjPixel.Y>=1andobjPixel.Y<=lHeightthen
ifPixel(objPixel.X,objPixel.Y)ForegroundColourIndexandPixel(objPixel.X,objPixel.Y)=lOldPixelthen
Pixel(objPixel.X,objPixel.Y)=ForegroundColourIndex

aPixelStack.PushobjPixel.X+1,objPixel.Y
aPixelStack.PushobjPixel.X-1,objPixel.Y
aPixelStack.PushobjPixel.X,objPixel.Y+1
aPixelStack.PushobjPixel.X,objPixel.Y-1
endif
endif
wend
endsub

publicsubPolygon(aX,aY,bJoin)
DimiTemp
DimlUpper
ifUBound(aX)UBound(aY)thenexitsub
ifUBound(aX)<1thenexitsubMustbemorethanonepoint

lUpper=UBound(aX)-1

DrawaseriesoflinesfromarraysaXandaY
foriTemp=1tolUpper
LineaX(iTemp-1),aY(iTemp-1),aX(iTemp),aY(iTemp)
next

ifbJointhen
LineaX(lUpper),aY(lUpper),aX(0),aY(0)
endif
endsub
Easyas,err,rectangle?
publicsubPieSlice(lX,lY,lRadius,sinStartAngle,sinArcAngle,bFilled)
DimsinActualAngle
DimsinMidAngle
DimlX2
DimlY2
DimiTemp

ArclX,lY,lRadius,lRadius,sinStartAngle,sinArcAngle
AngleLinelX,lY,lRadius,sinStartAngle
sinActualAngle=sinStartAngle+sinArcAngle
ifsinActualAngle>360then
sinActualAngle=sinActualAngle-360
endif
AngleLinelX,lY,lRadius,sinActualAngle
Nowpickastartfloodpointatthefurthestpointfromthecenter
Dividethearcangleby2
sinMidAngle=sinStartAngle+(sinArcAngle/2)

ifsinMidAngle>360then
sinMidAngle=sinMidAngle-360
endif
ifbFilledthen
foriTemp=1tolRadius-1
lY2=CInt(lY+(Sin(DegreesToRadians(sinMidAngle))*iTemp))
lX2=CInt(lX+(Cos(DegreesToRadians(sinMidAngle))*iTemp))
FloodlX2,lY2
next
endif
endsub
publicsubBezier(lX1,lY1,lCX1,lCY1,lCX2,lCY2,lX2,lY2,lPointCount)
DimsinT
dimlX,lY,lLastX,lLastY
dimsinResolution

iflPointCount=0thenexitsub

sinResolution=1/lPointCount

sinT=0

lLastX=lX1
lLastY=lY1

whilesinT<=1
lX=int(((sinT^3)*-1+(sinT^2)*3+sinT*-3+1)*lX1+((sinT^3)*3+(sinT^2)*-6+sinT*3)*lCX1+((sinT^3)*-3+(sinT^2)*3)*lCX2+(sinT^3)*lX2)
lY=int(((sinT^3)*-1+(sinT^2)*3+sinT*-3+1)*lY1+((sinT^3)*3+(sinT^2)*-6+sinT*3)*lCY1+((sinT^3)*-3+(sinT^2)*3)*lCY2+(sinT^3)*lY2)
LinelLastX,lLastY,lX,lY

lLastX=lX
lLastY=lY

sinT=sinT+sinResolution
wend
LinelLastX,lLastY,lX2,lY2

endsub
ArcPixelKindlydonatedbywebjx.com(www.webjx.com)
PrivateSubArcPixel(lX,lY,ltX,ltY,sinStart,sinEnd)
DimdAngle

IfltX=0Then
dAngle=Sgn(ltY)*PI/2
ElseIfltX<0AndltY<0Then
dAngle=PI+Atn(ltY/ltX)
ElseIfltX<0Then
dAngle=PI-Atn(-ltY/ltX)
ElseIfltY<0Then
dAngle=2*PI-Atn(-ltY/ltX)
Else
dAngle=Atn(ltY/ltX)
EndIf

IfdAngle<0ThendAngle=2*PI+dAngle
Compensationforradiispanningover0degreemarker
ifsinEnd>DegreesToRadians(360)anddAngle<(sinEnd-DegreesToRadians(360))then
dAngle=dAngle+DegreesToRadians(360)
endif

IfsinStart<sinEndAnd(dAngle>sinStartAnddAngle<sinEnd)Then
Thisisthe"corrected"angle
Tochangeback,changetheminustoaplus
Pixel(lX+ltX,lY+ltY)=ForegroundColourIndex
EndIf
EndSub

ArcKindlydonatedbyRichardDeeming(www.webjx.com),vastimprovementonthe
previouslykludgyArcfunction.
PublicSubArc(ByVallX,ByVallY,ByVallRadiusX,ByVallRadiusY,ByValsinStartAngle,ByValsinArcAngle)
DrawanarcatpointlX,lYwithradiuslRadius
runningfromsinStartAngledegreesforsinArcAngledegrees
DimlAlpha,lBeta,S,T,lTempX,lTempY
DimdStart,dEnd

dStart=DegreesToRadians(sinStartAngle)
dEnd=dStart+DegreesToRadians(sinArcAngle)

lAlpha=lRadiusX*lRadiusX
lBeta=lRadiusY*lRadiusY
lTempX=0
lTempY=lRadiusY
S=lAlpha*(1-2*lRadiusY)+2*lBeta
T=lBeta-2*lAlpha*(2*lRadiusY-1)
ArcPixellX,lY,lTempX,lTempY,dStart,dEnd
ArcPixellX,lY,-lTempX,lTempY,dStart,dEnd
ArcPixellX,lY,lTempX,-lTempY,dStart,dEnd
ArcPixellX,lY,-lTempX,-lTempY,dStart,dEnd
Do
IfS<0Then
S=S+2*lBeta*(2*lTempX+3)
T=T+4*lBeta*(lTempX+1)
lTempX=lTempX+1
ElseIfT<0Then
S=S+2*lBeta*(2*lTempX+3)-4*lAlpha*(lTempY-1)
T=T+4*lBeta*(lTempX+1)-2*lAlpha*(2*lTempY-3)
lTempX=lTempX+1
lTempY=lTempY-1
Else
S=S-4*lAlpha*(lTempY-1)
T=T-2*lAlpha*(2*lTempY-3)
lTempY=lTempY-1
EndIf
ArcPixellX,lY,lTempX,lTempY,dStart,dEnd
ArcPixellX,lY,-lTempX,lTempY,dStart,dEnd
ArcPixellX,lY,lTempX,-lTempY,dStart,dEnd
ArcPixellX,lY,-lTempX,-lTempY,dStart,dEnd
LoopWhilelTempY>0
EndSub
publicsubAngleLine(ByVallX,ByVallY,ByVallRadius,ByValsinAngle)
Drawalineatanangle
Anglesstartfromthetopverticalandworkclockwise
Workoutthedestinationdefinedbylengthandangle
DimlX2
DimlY2

lY2=(Sin(DegreesToRadians(sinAngle))*lRadius)
lX2=(Cos(DegreesToRadians(sinAngle))*lRadius)

LinelX,lY,lX+lX2,lY+lY2
endsub
Bresenhamlinealgorithm,thisisprettyquick,onlyusespointtopointtoavoidthe
mid-pointproblem
publicsubLine(ByVallX1,ByVallY1,ByVallX2,ByVallY2)
DimlDX
DimlDY
DimlXIncrement
DimlYIncrement
DimlDPr
DimlDPru
DimlP

lDX=Abs(lX2-lX1)
lDY=Abs(lY2-lY1)

iflX1>lX2then
lXIncrement=-1
else
lXIncrement=1
endif

iflY1>lY2then
lYIncrement=-1
else
lYIncrement=1
endif

iflDX>=lDYthen
lDPr=ShiftLeft(lDY,1)
lDPru=lDPr-ShiftLeft(lDX,1)
lP=lDPr-lDX

whilelDX>=0
Pixel(lX1,lY1)=ForegroundColourIndex
iflP>0then
lX1=lX1+lXIncrement
lY1=lY1+lYIncrement
lP=lP+lDPru
else
lX1=lX1+lXIncrement
lP=lP+lDPr
endif
lDX=lDX-1
wend
else
lDPr=ShiftLeft(lDX,1)
lDPru=lDPr-ShiftLeft(lDY,1)
lP=lDPR-lDY

whilelDY>=0
Pixel(lX1,lY1)=ForegroundColourIndex
iflP>0then
lX1=lX1+lXIncrement
lY1=lY1+lYIncrement
lP=lP+lDPru
else
lY1=lY1+lYIncrement
lP=lP+lDPr
endif
lDY=lDY-1
wend
endif

endsub
publicsubRectangle(ByVallX1,ByVallY1,ByVallX2,ByVallY2)
Easyaspie,well,actuallypieisanotherfunction...drawfourlines
LinelX1,lY1,lX2,lY1
LinelX2,lY1,lX2,lY2
LinelX2,lY2,lX1,lY2
LinelX1,lY2,lX1,lY1
endsub
publicsubCircle(ByVallX,ByVallY,ByVallRadius)
EllipselX,lY,lRadius,lRadius
endsub
Bresenhamellispe,prettyquickalso,usesreflection,sorotationisoutofthe
questionunlessweperformamatrixrotationafterrenderingtheellipsecoords
publicsubEllipse(ByVallX,ByVallY,ByVallRadiusX,ByVallRadiusY)
DrawacircleatpointlX,lYwithradiuslRadius
DimlAlpha,lBeta,S,T,lTempX,lTempY

lAlpha=lRadiusX*lRadiusX
lBeta=lRadiusY*lRadiusY
lTempX=0
lTempY=lRadiusY
S=lAlpha*(1-2*lRadiusY)+2*lBeta
T=lBeta-2*lAlpha*(2*lRadiusY-1)
Pixel(lX+lTempX,lY+lTempY)=ForegroundColourIndex
Pixel(lX-lTempX,lY+lTempY)=ForegroundColourIndex
Pixel(lX+lTempX,lY-lTempY)=ForegroundColourIndex
Pixel(lX-lTempX,lY-lTempY)=ForegroundColourIndex
Do
ifS<0then
S=S+2*lBeta*(2*lTempX+3)
T=T+4*lBeta*(lTempX+1)
lTempX=lTempX+1
elseifT<0then
S=S+2*lBeta*(2*lTempX+3)-4*lAlpha*(lTempY-1)
T=T+4*lBeta*(lTempX+1)-2*lAlpha*(2*lTempY-3)
lTempX=lTempX+1
lTempY=lTempY-1
else
S=S-4*lAlpha*(lTempY-1)
T=T-2*lAlpha*(2*lTempY-3)
lTempY=lTempY-1
endif
Pixel(lX+lTempX,lY+lTempY)=ForegroundColourIndex
Pixel(lX-lTempX,lY+lTempY)=ForegroundColourIndex
Pixel(lX+lTempX,lY-lTempY)=ForegroundColourIndex
Pixel(lX-lTempX,lY-lTempY)=ForegroundColourIndex
loopwhilelTempY>0
endsub
Vectorfontsupport
Thesefontsaredescribedintermsofpointsonagridwithsimple
XandYoffsets.Thesefunctionstakeelementsofastringandrender
themfromarraysstoringcharactervectorinformation.Vectorfontsare
haveproportionalwidths,unlikebitmappedfontswhicharefixedinsize
Theformatforthevectorarrayissimplyavariablelengthlistofxypairs
thesubDrawVectorCharrendersthesinglecharacterfromthearray.
Theotheradvantageofvectorfontsisthattheycanbescaled:)
Maybeaddananglevalue?
publicsubDrawVectorTextWE(ByVallX,ByVallY,sText,lSize)
DimiTemp
DimlCurrentStringX

lCurrentStringX=lX

ForiTemp=1toLen(sText)
lCurrentStringX=lCurrentStringX+DrawVectorChar(lCurrentStringX,lY,Mid(sText,iTemp,1),lSize,true)+int(lSize)
Next
endsub

publicsubDrawVectorTextNS(ByVallX,ByVallY,sText,lSize)
DimiTemp
DimlCurrentStringY

lCurrentStringY=lY

ForiTemp=1toLen(sText)
lCurrentStringY=lCurrentStringY+DrawVectorChar(lX,lCurrentStringY,Mid(sText,iTemp,1),lSize,false)+int(lSize)
Next
endsub

privatefunctionDrawVectorChar(ByVallX,ByVallY,sChar,lSize,bOrientation)
DimiTemp
DimaFont
DimlLargestWidth

ifsChar""then
aFont=VFont(sChar)

ifbOrientationthen
lLargest=aFont(1,0)*lSize
else
lLargest=aFont(1,1)*lSize
endif

foriTemp=1toUBound(aFont,1)-1
ifbOrientationthen
ifaFont(iTemp,2)=1thenPendown
LinelX+aFont(iTemp-1,0)*lSize,lY+aFont(iTemp-1,1)*lSize,lX+aFont(iTemp,0)*lSize,lY+aFont(iTemp,1)*lSize
endif
if(aFont(iTemp,0)*lSize)>lLargestthen
lLargest=aFont(iTemp,0)*lSize
endif
else
ifaFont(iTemp,2)=1thenPendown
LinelX+aFont(iTemp-1,0)*lSize,lY+aFont(iTemp-1,1)*lSize,lX+aFont(iTemp,0)*lSize,lY+aFont(iTemp,1)*lSize
endif
if(aFont(iTemp,1)*lSize)>lLargestthen
lLargest=aFont(iTemp,1)*lSize
endif
endif
next
else
lLargest=lSize*3
endif

Returnthewidthofthecharacter
DrawVectorChar=lLargest
endfunction
Bitmapfontsupport
publicsubDrawTextWE(ByVallX,ByVallY,sText)
RendertextatlX,lY
TheresaglobaldictionaryobjectcalledFontanditshouldcontainallthe
lettersinarraysofa5x5grid
DimiTemp1
DimiTemp2
DimiTemp3
DimbChar

ForiTemp1=0toUBound(Letter)-1
ForiTemp2=1tolen(sText)
ForiTemp3=1toLen(Font(Mid(sText,iTemp2,1))(iTemp1))
bChar=Mid(Font(Mid(sText,iTemp2,1))(iTemp1),iTemp3,1)
ifbChar"0"then
Pixel(lX+((iTemp2-1)*Len(Letter(0)))+iTemp3,lY+iTemp1)=CLng(bChar)
endif
next
next
next
endsub
publicsubDrawTextNS(ByVallX,ByVallY,sText)
RendertextatlX,lY
TheresaglobaldictionaryobjectcalledFontanditshouldcontainallthe
lettersinarraysofa5x5grid
DimiTemp1
DimiTemp2
DimiTemp3
DimbChar
foriTemp1=1tolen(sText)
foriTemp2=0toUBound(Letter)-1
foriTemp3=1tolen(Font(Mid(sText,iTemp1,1))(iTemp2))
bChar=Mid(Font(Mid(sText,iTemp1,1))(iTemp2),iTemp3,1)
ifbChar"0"then
Pixel(lX+iTemp3,lY+(iTemp1*(UBound(Letter)+1))+iTemp2)=CLng(bChar)
endif
next
next
next
endsub
Cleartheimage,becauseStringsendsoutUNICODEcharacters,wedoubleuptheindexasaWORD
publicsubClear()
Possiblyquicker,butalittlelessaccurate
sImage=String(lWidth*((lHeight+1)/2),ChrB(BackgroundColourIndex)&ChrB(BackgroundColourIndex))
endsub

publicsubResize(ByVallNewWidth,ByVallNewHeight,bPreserve)
Resizetheimage,dontstretch
DimsOldImage
DimlOldWidth
DimlOldHeight
DimlCopyWidth
DimlCopyHeight
DimlX
DimlY

ifbPreservethen
sOldImage=sImage
lOldWidth=lWidth
lOldHeight=lHeight
endif
lWidth=lNewWidth
lHeight=lNewHeight
Clear

ifbPreservethen
Nowcopytheoldimageintothenew
iflNewWidth>lOldWidththen
lCopyWidth=lOldWidth
else
lCopyWidth=lNewWidth
endif

iflNewHeight>lOldHeightthen
lCopyHeight=lOldHeight
else
lCopyHeight=lNewHeight
endif
Nowsetthenewwidthandheight
lWidth=lNewWidth
lHeight=lNewHeight

Copytheoldbitmapover,possiblycoulddowithimprovement,thisdoesit
onapixelleve,thereisroomheretoperformaMidBfromonestringtoanother
forlY=1tolCopyHeight
forlX=1tolCopyWidth
Pixel(lX,lY)=AscB(MidB(sOldImage,(lOldWidth*(lY-1))+lX,1))
next
next
endif
endsub

***************************************************************************
*************************GIFManagementfunctions************************
***************************************************************************

publicpropertygetTextImageData()
DimiTemp
DimsText

sText=ImageData

TextImageData=""

foriTemp=1toLenB(sText)
TextImageData=TextImageData&Chr(AscB(Midb(sText,iTemp,1)))
next
endproperty

DumptheimageoutasaGIF87a
publicpropertygetImageData()
DimsText
DimlTemp

ImageData=MagicNumber
ImageData=ImageData&MakeWord(lWidth)
ImageData=ImageData&MakeWord(lHeight)
ImageData=ImageData&MakeByte(GlobalDescriptor)
ImageData=ImageData&MakeByte(BackgroundColourIndex)
ImageData=ImageData&MakeByte(bytePixelAspectRatio)
ImageData=ImageData&GetGlobalColourTable
<P>ifGIF89athen
Supportforextendedblocks
ifUseTransparencythen
ImageData=ImageData&MakeByte(byteGraphicControl)
ImageData=ImageData&MakeByte(&HF9)
ImageData=ImageData&MakeByte(&H04)
ImageData=ImageData&MakeByte(1)
ImageData=ImageData&MakeWord(0)
ImageData=ImageData&MakeByte(TransparentColourIndex)
ImageData=ImageData&MakeByte(0)
endif
ifComment""then
ImageData=ImageData&MakeByte(byteGraphicControl)
ImageData=ImageData&MakeByte(&HFE)
sText=Left(Comment,255)Truncateto255characters
ImageData=ImageData&MakeByte(Len(sText))
ForlTemp=1toLen(sText)
ImageData=ImageData&MakeByte(Asc(Mid(sText,lTemp,1)))
Next
ImageData=Ima写软件都是想的时间比写的时间要长的.如果反过来了就得看看是什么原因了.另外大家可以回去问问公司里的小MM.(一般企业里,跟你们交付软件接触得最多的是她们)

柔情似水 发表于 2015-1-19 09:07:58

运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写,使用普通的文本编辑器编写,如记事本就可以完成。由脚本在服务器上而不是客户端运行,ASP所使用的脚本语言都在服务端上运行。

活着的死人 发表于 2015-1-25 19:26:06

学习是为了用的,是为了让你的程序产生价值,把握住这个原则会比较轻松点。除此之外,课外时间一定要多参加一些社会实践活动,来锻炼自己的能力。

不帅 发表于 2015-2-3 17:05:50

先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习

海妖 发表于 2015-2-9 04:13:30

代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。

简单生活 发表于 2015-2-26 21:35:38

Application:这个存储服务端的数据,如果不清除,会直到web应用程序结束才清除(例如重启站点)

金色的骷髅 发表于 2015-3-8 18:07:09

下载一个源代码,然后再下载一个VBScript帮助,在源代码中遇到不认识的函数或是其他什么程序,都可以查帮助进行解决,这样学习效率很高。

精灵巫婆 发表于 2015-3-16 10:02:22

以HTML语言整合(HTML负责界面上,ASP则负责功能上)形成一个B/S(浏览器/服务器)模式的网页程序。

第二个灵魂 发表于 2015-3-22 22:11:33

ASP也是这几种脚本语言中最简单易学的开发语言。但ASP也是这几种语言中唯一的一个不能很好支持跨平台的语言。  因为ASP脚本语言非常简单,因此其代码也简单易懂,结合HTML代码,可快速地完成网站的应用程序。
页: [1]
查看完整版本: ASP网页编程之ASP不必要组件天生图片考证码的办法