I've this script on my program to read R component of an image and save it on an array:
Dim citra_asli As Bitmap = New Bitmap(PictureBoxAsli.Image)
Dim i As Integer = 0
Dim j As Integer = 0
Dim redValue(i, j) As Integer
ListBox3.Items.Add("Piksel--R--G--B")
For i = 0 To ((citra_asli.Height) - 1)
For j = 0 To ((citra_asli.Width) - 1)
Dim R As Integer = citra_asli.GetPixel(i, j).R
redValue(i, j) = R
ListBox3.Items.Add((i.ToString + ("," + (j.ToString + (" " + (redValue(i, j).ToString))))))
Next
Next
unfortunately I always get this error message "Index was outside the bounds of the array.". As long as I know, the redValue() array and citra_asli bitmap have identically dimension but why the error message appear? Somebody help me please or maybe there's another method to save it on an array. Thank you and please forgive me for my poor English.