Public Class XBMEngine
Private m_width As Long
Private m_height As Long
Private m_value As String
Private m_ValueMap List As Variant
Private m_Contents List As Variant
Public Sub New
m_Contents("unknown")=UtilSplit("0x00;0x00;0x00;0x00;0x00;0x00;0x00;0x00;0x00;0x00",";")
XBMEngine_Child_Init
End Sub
Private Function XBMEngine_Child_Init As Long
End Function
' get the output string value
' toString is belong to system function
Public Function OutString
OutString=HeadString & BodyString
End Function
Private Function HeadString
m_Width= 8 * Len(m_Value)
HeadString=""
HeadString=HeadString & "#define count_width " & m_Width & Chr(10)
HeadString=HeadString & "#define count_height " & m_Height & Chr(10)
End Function
Private Function BodyString
Dim i As Long , j As Long , sRet
Dim iLen As Long , v1
iLen=Len(m_Value)
GetValueMap
sRet=""
sRet=sRet & "static char count_bits[] = {" & Chr(10)
For j=1 To m_Height
For i=1 To iLen
v1=m_ValueMap(Cstr(i))
sRet=sRet & v1(j-1) & ","
Next
Next
sRet=sRet & Chr(10) & "};"
BodyString=sRet
End Function
Private Function GetValueMap() As Variant
Dim i As Long
Dim sTag As String
For i=1 To Len(m_Value)
sTag=Mid(m_Value , i ,1)
If Iselement(m_Contents(sTag)) Then
m_ValueMap(Cstr(i))=m_Contents(sTag)
Else
m_ValueMap(Cstr(i))=m_Contents("unknown")
End If
Next
End Function
Public Property Set Value As String
m_Value=Value
End Property
End Class
Public Class XBMEngineHA As XBMEngine
' height 10
Private Function XBMEngine_Child_Init As Long
m_Height=10
XBMEngineHA_Child_Init
End Function
Private Function XBMEngineHA_Child_Init As Long
End Function
End Class
Public Class XBMEngineHANumber As XBMEngineHA
Private Function XBMEngineHA_Child_Init As Long
m_Height=10
'数字0
m_Contents("0")=UtilSplit("0x3c;0x66;0xc3;0xc3;0xc3;0xc3;0xc3;0xc3;0x66;0x3c",";")
'数字1
m_Contents("1")=UtilSplit("0x18;0x1c;0x18;0x18;0x18;0x18;0x18;0x18;0x18;0x7e",";")
'数字2
m_Contents("2")=UtilSplit("0x3c;0x66;0x60;0x60;0x30;0x18;0x0c;0x06;0x06;0x7e",";")
'数字3
m_Contents("3")=UtilSplit("0x3c;0x66;0xc0;0x60;0x1c;0x60;0xc0;0xc0;0x66;0x38",";")
'数字4
m_Contents("4")=UtilSplit("0x38;0x3c;0x36;0x33;0x33;0x33;0xff;0x30;0x30;0xfe",";")
'数字5
m_Contents("5")=UtilSplit("0xfe;0xfe;0x06;0x06;0x3e;0x60;0xc0;0xc3;0x66;0x3c",";")
'数字6
m_Contents("6")=UtilSplit("0x60;0x30;0x18;0x0c;0x3e;0x63;0xc3;0xc3;0x66;0x3c",";")
'数字7
m_Contents("7")=UtilSplit("0xff;0xc0;0x60;0x30;0x18;0x18;0x18;0x18;0x18;0x18",";")
'数字8
m_Contents("8")=UtilSplit("0x3c;0x66;0xc3;0x66;0x3c;0x66;0xc3;0xc3;0x66;0x3c",";")
'数字9
m_Contents("9")=UtilSplit("0x3c;0x66;0xc3;0xc3;0x66;0x3c;0x18;0x0c;0x06;0x03",";")
End Function
End Class