如何使用带有c++的果酱进行屏幕截图
How to take screenshots using marmalade with c++?
我沿着文档进行了搜索,但一无所获,然后在谷歌上搜索后,我找到了这个glReadPixels,我想我可能可以截屏了。
我需要创建一个有图像的Facebook对话框,所以我使用以下行:
static s3eFBRequest* req = s3eFBRequest_WithGraphPath(MultiLoginScene::getSession(), "me/photos", "POST");
s3eFBRequest_AddParamString(req, "picture", XXX);
XXX是一个const char*,这将是我需要拍摄的屏幕截图,然后我将发送请求。
我该怎么做?
Marmalade网站不见了。不幸的是,这里没有公布答案,只是简短地说:
int w = s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
int h = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT);
int dataSize = w * h * 3;
unsigned char *framebuffer = (unsigned char *) malloc(dataSize * sizeof(unsigned char));
glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, framebuffer);
flipVertical(framebuffer, w, h);
CIwImage image;
image.SetFormat(CIwImage::BGR_888);
image.SetWidth(w);
image.SetHeight(h);
image.SetBuffers(framebuffer, dataSize);
image.SavePng(filename);
free(framebuffer);
你必须首先在果酱网站上搜索这些功能。这里已经有一个非常好的书面答案了。
附言:请停止发布多个问题问同一件事。
相关文章:
- Winapi:屏幕截图未显示在窗口中
- 截取屏幕截图后程序卡住
- C++鼠标单击时的屏幕截图不起作用
- GTKMM:拍摄绘图区域的屏幕截图?
- 有没有办法使用 ofstream 保存屏幕截图?
- 如何使用 DX11 截取屏幕截图?
- avcodec_receive_packet错误(gdi 屏幕截图 + ffmpeg)
- C++屏幕截图 - 如何读取位图?
- 使用QT C 屏幕截图
- 如何将屏幕截图位图转换为 cv::Mat
- QT自动保存使用命名模板的屏幕截图
- C 屏幕截图
- BMP的完整屏幕截图.与块状和保存有关的问题
- 使用OpenCV和C++在按键上截取网络摄像头源的屏幕截图
- DirectX 部分屏幕截图
- 截取屏幕截图,分析它,然后删除它
- WXWIDGETS应用于WXStaticBitMap时,屏幕截图将大部分图像留为空白
- 屏幕截图桌面DirectX C /QT
- 从另一个桌面捕获屏幕截图
- 如何使用带有c++的果酱进行屏幕截图