Scale the Contents of pixelBuffer

Hi,
I m newbie to OpenGl.I have 1024768 image in pixel buffer.
But i need a 352
288 image in same pixel buffer.
How can I do it?
I have gone through the topics but couldn’t find an answer.
If the question is repeated kindly excuse me. :slight_smile:

You can upload the data stored in the pixel buffer into a texture using glTexImage2D and render a quad which resizes the image to the needed size in pixel (this needs the correct adjustment of the modelview matrix).
After this you should read back the content of the framebuffer to the pixel buffer using glReadPixels.

Thanks for reply.
But my problem is not solved.I tried like this.

glTexImage2d(GL_TEXTURE_2D,0,GL_BGRA,1152,864,0,GL_BGRA,GL_UNSIGNED_BYTE,baseaddofpixelBuf);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glScalef(3.3,3,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

After this i used glReadPixels to read data into pixelBuf and found image is still in 1152*864.

Any help is appreciated.
Thanks in advance

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.