title: Save R component from image RGB to an arrray on VB.Net 2010
body: <p>I've this script on my program to read R component of an image and save it on an array:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>