C++ (Qt)glRasterPos2i(0, 0);glPixelZoom(1.0f, 1.0f);glPixelTransferf(GL_ALPHA_SCALE, 1.0); glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldAlign);glGetIntegerv(GL_UNPACK_ROW_LENGTH, &oldLen); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); glPixelStorei(GL_UNPACK_ALIGNMENT, oldAlogn); glPixelStorei(GL_UNPACK_ROW_LENGTH, oldLen);