<%
Option Explicit

dim dim_xmp(10,10)
call load_dim_xmp()
dim xmp_num,xmp_image,xmp_width,xmp_height,xmp_sort,xmp_hc,i,j

xmp_num=trim(request.querystring())
if not(isnumeric(xmp_num)) then
  xmp_num="0000"
end if

xmp_width=8*len(xmp_num)
xmp_height=10
xmp_hc=chr(13)&chr(10)

redim xmp_sort(len(xmp_num))
for i=1 to len(xmp_num)
  xmp_sort(i)=mid(xmp_num,i,1)
next

xmp_image="#define counter_width "&xmp_width&xmp_hc & _
	  "#define counter_height "&xmp_height&xmp_hc & _
	  "static unsigned char counter_bits[]={"&xmp_hc
for i=1 to xmp_height
  for j=1 to len(xmp_num)
    xmp_image=xmp_image&dim_xmp(xmp_sort(j),i)&","
  next
next
xmp_image=left(xmp_image,len(xmp_image)-1)
xmp_image=xmp_image&"};"&xmp_hc
erase dim_xmp

with response
  .buffer=true
  .expires=-1
  .addheader "pragma","no-cache"
  .addheader "cache-ctrol","no-cache"
  .contenttype="image/x-xbitmap"	'image/gif,application/octet-stream
  .write xmp_image
end with

sub load_dim_xmp()
  dim_xmp(0,1)="0x3c"	'数字0
  dim_xmp(0,2)="0x66"
  dim_xmp(0,3)="0xc3"
  dim_xmp(0,4)="0xc3"
  dim_xmp(0,5)="0xc3"
  dim_xmp(0,6)="0xc3"
  dim_xmp(0,7)="0xc3"
  dim_xmp(0,8)="0xc3"
  dim_xmp(0,9)="0x66"
  dim_xmp(0,10)="0x3c"
  dim_xmp(1,1)="0x18"	'数字1
  dim_xmp(1,2)="0x1c"
  dim_xmp(1,3)="0x18"
  dim_xmp(1,4)="0x18"
  dim_xmp(1,5)="0x18"
  dim_xmp(1,6)="0x18"
  dim_xmp(1,7)="0x18"
  dim_xmp(1,8)="0x18"
  dim_xmp(1,9)="0x18"
  dim_xmp(1,10)="0x7e"
  dim_xmp(2,1)="0x3c"	'数字2
  dim_xmp(2,2)="0x66"
  dim_xmp(2,3)="0x60"
  dim_xmp(2,4)="0x60"
  dim_xmp(2,5)="0x30"
  dim_xmp(2,6)="0x18"
  dim_xmp(2,7)="0x0c"
  dim_xmp(2,8)="0x06"
  dim_xmp(2,9)="0x06"
  dim_xmp(2,10)="0x7e"
  dim_xmp(3,1)="0x3c"	'数字3
  dim_xmp(3,2)="0x66"
  dim_xmp(3,3)="0xc0"
  dim_xmp(3,4)="0x60"
  dim_xmp(3,5)="0x1c"
  dim_xmp(3,6)="0x60"
  dim_xmp(3,7)="0xc0"
  dim_xmp(3,8)="0xc0"
  dim_xmp(3,9)="0x66"
  dim_xmp(3,10)="0x38"
  dim_xmp(4,1)="0x38"	'数字4
  dim_xmp(4,2)="0x3c"
  dim_xmp(4,3)="0x36"
  dim_xmp(4,4)="0x33"
  dim_xmp(4,5)="0x33"
  dim_xmp(4,6)="0x33"
  dim_xmp(4,7)="0xff"
  dim_xmp(4,8)="0x30"
  dim_xmp(4,9)="0x30"
  dim_xmp(4,10)="0xfe"
  dim_xmp(5,1)="0xfe"	'数字5
  dim_xmp(5,2)="0xfe"
  dim_xmp(5,3)="0x06"
  dim_xmp(5,4)="0x06"
  dim_xmp(5,5)="0x3e"
  dim_xmp(5,6)="0x60"
  dim_xmp(5,7)="0xc0"
  dim_xmp(5,8)="0xc3"
  dim_xmp(5,9)="0x66"
  dim_xmp(5,10)="0x3c"
  dim_xmp(6,1)="0x60"	'数字6
  dim_xmp(6,2)="0x30"
  dim_xmp(6,3)="0x18"
  dim_xmp(6,4)="0x0c"
  dim_xmp(6,5)="0x3e"
  dim_xmp(6,6)="0x63"
  dim_xmp(6,7)="0xc3"
  dim_xmp(6,8)="0xc3"
  dim_xmp(6,9)="0x66"
  dim_xmp(6,10) ="0x3c"
  dim_xmp(7,1)="0xff"	'数字7
  dim_xmp(7,2)="0xc0"
  dim_xmp(7,3)="0x60"
  dim_xmp(7,4)="0x30"
  dim_xmp(7,5)="0x18"
  dim_xmp(7,6)="0x18"
  dim_xmp(7,7)="0x18"
  dim_xmp(7,8)="0x18"
  dim_xmp(7,9)="0x18"
  dim_xmp(7,10)="0x18"
  dim_xmp(8,1)="0x3c"	'数字8
  dim_xmp(8,2)="0x66"
  dim_xmp(8,3)="0xc3"
  dim_xmp(8,4)="0x66"
  dim_xmp(8,5)="0x3c"
  dim_xmp(8,6)="0x66"
  dim_xmp(8,7)="0xc3"
  dim_xmp(8,8)="0xc3"
  dim_xmp(8,9)="0x66"
  dim_xmp(8,10)="0x3c"
  dim_xmp(9,1)="0x3c"	'数字9
  dim_xmp(9,2)="0x66"
  dim_xmp(9,3)="0xc3"
  dim_xmp(9,4)="0xc3"
  dim_xmp(9,5)="0x66"
  dim_xmp(9,6)="0x3c"
  dim_xmp(9,7)="0x18"
  dim_xmp(9,8)="0x0c"
  dim_xmp(9,9)="0x06"
  dim_xmp(9,10)="0x03"
end sub
%>