Hi @Mansour_Dalir ,
Swap the order of ArrayX and ArrayY in the two For Each loops.
Private Function output(ArrayX As Integer(), ArrayY As Integer()) As List(Of Point)
Dim ArrayResult As New List(Of Point)
For xIndex As Integer = 0 To ArrayX.Length - 2
For yIndex As Integer = 0 To ArrayY.Length - 2
Dim topLeft As New Point(ArrayX(xIndex), ArrayY(yIndex))
Dim bottomRight As New Point(ArrayX(xIndex + 1), ArrayY(yIndex + 1))
ArrayResult.Add(topLeft)
ArrayResult.Add(bottomRight)
Next
Next
Return ArrayResult
End Function