title: Unable to read pixels from bitmap using Xamarin
body: <p>I thought trying to get pixel data would be a simple thing to do, but it has become a big headache.</p>
  
  <p>My original goal is to go through every pixel in the bitmap and then do some modification with the data. However every time I try to get the pixel I get 0 as a result. It feels like the image is not going to the bitmap. Am I missing something in my code or the code in general wrong? </p>
  
  <pre><code>protected override void OnCreate(Bundle bundle)
  
  {
      base.OnCreate(bundle);
  
  
          SetContentView(Resource.Layout.Main);
  
          var imageView1 = FindViewById&lt;ImageView&gt;(Resource.Id.imageView1);
          imageView1.SetImageResource(Resource.Drawable.pic1);
  
          Bitmap b = BitmapFactory.DecodeResource(Resources,Resource.Drawable.pic1);
          b = Bitmap.CreateBitmap(b);
  
          imageView1.SetImageBitmap(b);
  
          for (int i = 0; i &lt; width; i++)
          {
              for (int j = 0; j &lt; height; j++)
              {
  
                  int pixel = b.GetPixel(i, j);
  
                  int A = Color.GetAlphaComponent(pixel);
                  int R = Color.GetRedComponent(pixel);
                  int G = Color.GetGreenComponent(pixel);
                  int B = Color.GetBlueComponent(pixel);
              }
          }
      }
  </code></pre>