# about  glReadPixels  API

**URL:** <https://forums.imgtec.com/t/about-glreadpixels-api/185>\
**Category:** PowerVR Insider\
**Created:** [November 14, 2008, 2:49am UTC](https://forums.imgtec.com/t/about-glreadpixels-api/185 "2008-11-14T02:49:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gordongao](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@gordongao](https://forums.imgtec.com/u/gordongao)\
**Post date:** [November 14, 2008, 2:49am UTC](https://forums.imgtec.com/t/about-glreadpixels-api/185/1 "2008-11-14T02:49:42Z")

</div>

I use glReadPixels&nbsp; to capture my colorbuffer&nbsp; on symbian s60 3rd, but&nbsp; only get the first pixel of my framebuffer, and the pixel copy to all other array ,such as code below:

&nbsp;
  

unsigned char \* imageData;
  

imageData = new unsigned char[3 \* width \* height];
  

glReadPixels(0,0, width, height,GL\_RGB,GL\_UNSIGNED\_BYTE, (unsigned char\*)imageData);
  

&nbsp;
  

all the data in imageData are the same as the first pixel of framebuffer, I don't why ??
  

&nbsp;
  

&nbsp;
  

and my egl setting as below:
  

&nbsp;
  

EGLConfig\<FONT face="Courier

---

<div class="post-metadata">

**Author:** ![xmas](https://avatars.discourse-cdn.com/v4/letter/x/958977/32.png) [@xmas](https://forums.imgtec.com/u/xmas)\
**Post date:** [November 14, 2008, 9:11am UTC](https://forums.imgtec.com/t/about-glreadpixels-api/185/2 "2008-11-14T09:11:57Z")

</div>

gordongao wrote:

glReadPixels(0,0, width, height,GL\_RGB,GL\_UNSIGNED\_BYTE, (unsigned char\*)imageData);

  
Please check the values of GL\_IMPLEMENTATION\_COLOR\_READ\_FORMAT\_OES and  
  
GL\_IMPLEMENTATION\_COLOR\_READ\_TYPE\_OES with glGetIntegerv before using a format/type combination other than GL\_RGBA, GL\_UNSIGNED\_BYTE with glReadPixels. GL\_RGBA, GL\_UNSIGNED\_BYTE is the only combination that is guaranteed to always work.  
  
  
  
Have you checked glGetError()?
