用ASP生成XBM數(shù)字圖片
發(fā)表時間:2024-05-27 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]XBM圖片是一個純文本的文件,可以用ASP來自動生成?梢杂盟鼇硎褂镁W(wǎng)站登陸的驗證碼; 我們用記事本打開該文件進行分析: 其文件結(jié)構(gòu)為: #define counter_width 48 #define counter_height 9 static unsigned char counter_b...
XBM圖片是一個純文本的文件,可以用ASP來自動生成?梢杂盟鼇硎褂镁W(wǎng)站登陸的驗證碼;
我們用記事本打開該文件進行分析:
其文件結(jié)構(gòu)為:
#define counter_width 48
#define counter_height 9
static unsigned char counter_bits[]={7c,3c,7c,3c,70,3c,fe,7c,fe,7c,78,7c,ee,ee,ee,ee,7c,ee,e0,ee,60,ee,74,ee,70,fe,30,fe,70,fe,38,ec,e0,ec,70,ec,1c,e0,ee,e0,70,e0,fe,7e,fe,7e,70,7e,fe,3c,7c,3c,70,3c}
文件擴展名為:.xbm
#define counter_width 48 '這兒定義的是圖片的寬度,一般為8的倍數(shù)
#define counter_height 9 '這兒定義的是圖片的高度,是任意的。
static unsigned char counter_bits[]={7c,3c,7c,3c,70,3c,fe,7c,fe,7c,78,7c,ee,ee,ee,ee,7c,ee,e0,ee,60,ee,74,ee,70,fe,30,fe,70,fe,38,ec,e0,ec,70,ec,1c,e0,ee,e0,70,e0,fe,7e,fe,7e,70,7e,fe,3c,7c,3c,70,3c} '這兒是圖片用來顯示內(nèi)容的十六進制的代碼
正如static unsigned char英文意思為靜態(tài)的,無符號的,燒焦的。它只能用來顯示黑白兩種顏色。二進制中的1將來用顯示為黑色,0為白色。
下面為0~9數(shù)字的二進制數(shù)組(其中的圖片樣式僅試用于本例。如果需要別的0~9數(shù)字樣式,請另自行生成)
'此處聲明0~9繪圖用數(shù)組
dim num(9,8)
'數(shù)字0
num(0,0)="0x38"
num(0,1)="0x7c"
num(0,2)="0xee"
num(0,3)="0xee"
num(0,4)="0xee"
num(0,5)="0xee"
num(0,6)="0xee"
num(0,7)="0x7c"
num(0,8)="0x38"
'數(shù)字1
num(1,0)="0x70"
num(1,1)="0x78"
num(1,2)="0x7c"
num(1,3)="0x74"
num(1,4)="0x70"
num(1,5)="0x70"
num(1,6)="0x70"
num(1,7)="0x70"
num(1,8)="0x70"
'數(shù)字2
num(2,0)="0x7c"
num(2,1)="0xfe"
num(2,2)="0xee"
num(2,3)="0xe0"
num(2,4)="0x70"
num(2,5)="0x38"
num(2,6)="0x1c"
num(2,7)="0xfe"
num(2,8)="0xfe"
'數(shù)字3
num(3,0)="0x7c"
num(3,1)="0xfe"
num(3,2)="0xee"
num(3,3)="0x60"
num(3,4)="0x30"
num(3,5)="0xe0"
num(3,6)="0xee"
num(3,7)="0xfe"
num(3,8)="0x7c"
'數(shù)字4
num(4,0)="0x70"
num(4,1)="0x78"
num(4,2)="0x7c"
num(4,3)="0x76"
num(4,4)="0x77"
num(4,5)="0xff"
num(4,6)="0xff"
num(4,7)="0x70"
num(4,8)="0x70"
'數(shù)字5
num(5,0)="0xfc"
num(5,1)="0xfc"
num(5,2)="0x0c"
num(5,3)="0x7e"
num(5,4)="0xfe"
num(5,5)="0xe0"
num(5,6)="0xee"
num(5,7)="0xfe"
num(5,8)="0x7c"
'數(shù)字6
num(6,0)="0x78"
num(6,1)="0xfc"
num(6,2)="0x0e"
num(6,3)="0x6e"
num(6,4)="0xfe"
num(6,5)="0xee"
num(6,6)="0xee"
num(6,7)="0xfc"
num(6,8)="0x78"
'數(shù)字7
num(7,0)="0xfe"
num(7,1)="0xfe"
num(7,2)="0x60"
num(7,3)="0x70"
num(7,4)="0x38"
num(7,5)="0x38"
num(7,6)="0x18"
num(7,7)="0x1c"
num(7,8)="0x1c"
'數(shù)字8
num(8,0)="0x7c"
num(8,1)="0xfe"
num(8,2)="0xee"
num(8,3)="0x7c"
num(8,4)="0x7c"
num(8,5)="0xee"
num(8,6)="0xee"
num(8,7)="0xfe "
num(8,8)="0x7c"
'數(shù)字9
num(9,0)="0x3c"
num(9,1)="0x7c"
num(9,2)="0xee"
num(9,3)="0xee"
num(9,4)="0xfe"
num(9,5)="0xec"
num(9,6)="0xe0"
num(9,7)="0x7e"
num(9,8)="0x3c"