Private Sub read_in_file_x_y_Color()
Dim X_array_for_read_from_file(500), Y_array_for_read_from_file(500) As Int16
Dim Color_array_for_read_from_file(500) As Byte
FileClose(1)
FileOpen(1, System.IO.Path.GetTempPath() + "\XY.hm", OpenMode.Binary)
' read data form file and save in array
Dim num_of_record As Integer
num_of_record = (LOF(1)) / 3
Dim record_temp1 As Int16
For index_read As Int16 = 1 To num_of_record
Dim temp As Int16
Dim color_temp As Byte
record_temp1 += 1
FileGet(1, temp, record_temp1)
X_array_for_read_from_file(index_read) = temp
record_temp1 += 1
FileGet(1, temp, record_temp1)
Y_array_for_read_from_file(index_read) = temp
record_temp1 += 1
FileGet(1, color_temp, record_temp1)
Color_array_for_read_from_file(index_read) = color_temp
Next
End Sub