VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Tile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim Bitplanes(0 To 3) As Bitplane

Private Sub Class_Initialize()
Set Bitplanes(0) = New Bitplane
Set Bitplanes(1) = New Bitplane
Set Bitplanes(2) = New Bitplane
Set Bitplanes(3) = New Bitplane
End Sub

Public Sub Init(Str As String)
Dim i As Long
Dim Strs(0 To 3) As String
For i = 1 To 29 Step 4
    Strs(0) = Strs(0) & Mid(Str, i, 2)
Next i
For i = 3 To 31 Step 4
    Strs(1) = Strs(1) & Mid(Str, i, 2)
Next i
For i = 33 To 61 Step 4
    Strs(2) = Strs(2) & Mid(Str, i, 2)
Next i
For i = 35 To 63 Step 4
    Strs(3) = Strs(3) & Mid(Str, i, 2)
Next i

For i = 0 To 3
    Bitplanes(i).Init (Strs(i))
Next i

End Sub

Public Function GetPixel(ByVal x As Integer, ByVal y As Integer) As Byte
GetPixel = Bin2Dec(Bitplanes(3).GetPixel(x, y) & Bitplanes(2).GetPixel(x, y) & Bitplanes(1).GetPixel(x, y) & Bitplanes(0).GetPixel(x, y))
End Function
