title: COCOS 2D screen shot is black in Android
body: <p>I am using the following code. The image is saved but it is BLACK.<br>
  Please see my code and tell me where I am doing wrong.<br>
  I am using this code in the Menu.    </p>
  
  <pre><code>case R.id.id_menu_Save:
  
              Bitmap bmp = SavePixels(0, 0, 800, 400, CCDirector.sharedDirector().gl);
  
              File file = new File("/sdcard/test.jpg");
              try
              {
                  file.createNewFile();
                  FileOutputStream fos = new FileOutputStream(file);
                  bmp.compress(CompressFormat.JPEG, 100, fos);
  
                  Toast.makeText(getApplicationContext(), "Image Saved", 0).show();
                  Log.i("Menu Save Button", "Image saved as JPEG");
              }
  
              catch (Exception e)
              {
                  e.printStackTrace();
              }
  
              break;
  </code></pre>
  
  <p>This is my Save Image Function.    </p>
  
  <pre><code>public static Bitmap SavePixels(int x, int y, int w, int h, GL10 gl)
  {  
       int b[]=new int[w*(y+h)];
       int bt[]=new int[w*h];
       IntBuffer ib=IntBuffer.wrap(b);
       ib.position(0);
       gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib);
  
       for(int i=0, k=0; i&lt;h; i++, k++)
       {//remember, that OpenGL bitmap is incompatible with Android bitmap
        //and so, some correction need.        
            for(int j=0; j&lt;w; j++)
            {
                 int pix=b[i*w+j];
                 int pb=(pix&gt;&gt;16)&amp;0xff;
                 int pr=(pix&lt;&lt;16)&amp;0x00ff0000;
                 int pix1=(pix&amp;0xff00ff00) | pr | pb;
                 bt[(h-k-1)*w+j]=pix1;
            }
       }
  
      Bitmap sb = Bitmap.createBitmap(bt, w, h, Bitmap.Config.ARGB_8888); 
      return sb;
  }
  </code></pre>
  
  <p>Apart from above, what I want from you is to point me in the right direction. Like if I have to get the pixels of the screen, what class/entity should I be exploring?</p>