我正在用glReadPixels进行截图,以在两幅图像之间执行“交叉”效果。OpenGL ES - glReadPixels
在果酱SDK模拟器截图取就好了和“交叉”效果的作品一种享受:
然而,这是它的外观上的iOS和Android设备 - 损坏: http://www.eikona.info/images/81269689420703803966.png
我总是阅读屏幕RGBA 1字节/通道,因为它总是被接受的documentation says。
这里是用来拍摄截图代码:
uint8* Gfx::ScreenshotBuffer(int& deviceWidth, int& deviceHeight, int& dataLength) {
/// width/height
deviceWidth = IwGxGetDeviceWidth();
deviceHeight = IwGxGetDeviceHeight();
int rowLength = deviceWidth * 4; /// data always returned by GL as RGBA, 1 byte/each
dataLength = rowLength * deviceHeight;
// set the target framebuffer to read
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
uint8* buffer = new uint8[dataLength];
glReadPixels(0, 0, deviceWidth, deviceHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
return buffer;
}
void Gfx::ScreenshotImage(CIwImage* img, uint8*& pbuffer) {
int deviceWidth, deviceHeight, dataLength;
pbuffer = ScreenshotBuffer(deviceWidth, deviceHeight, dataLength);
img->SetFormat(CIwImage::ABGR_8888);
img->SetWidth(deviceWidth);
img->SetHeight(deviceHeight);
img->SetBuffers(pbuffer, dataLength, 0, 0);
}
如果你删除你的'up-down'块,腐败消失了吗?只是倒过来?还是它被颠倒了? – sarnold
事情是,我没有设备,所以我需要发送给我的客户,然后等待他安装和测试......所有这些可能需要几天时间:-( –
上述评论是现在无需重新编辑我的消息,以反映我的新发现 –