VC++中抓屏问题 谁懂抓屏问题呀给小弟指点指点很急呀 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在www.vckbase.com中有你要的答案。类似QQ截屏。你搜索下“QQ”,就可以找到了。 一般截屏,google下一大把如果要截播放器 游戏等使用了硬件加速的内容,有点麻烦 下面是MSDN中的一段代码:// Create a normal DC and a memory DC for the entire screen. The // normal DC provides a "snapshot" of the screen contents. The // memory DC keeps a copy of this "snapshot" in the associated // bitmap. hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL); hdcCompatible = CreateCompatibleDC(hdcScreen); // Create a compatible bitmap for hdcScreen. hbmScreen = CreateCompatibleBitmap(hdcScreen, GetDeviceCaps(hdcScreen, HORZRES), GetDeviceCaps(hdcScreen, VERTRES)); if (hbmScreen == 0) errhandler("hbmScreen", hwnd); // Select the bitmaps into the compatible DC. if (!SelectObject(hdcCompatible, hbmScreen)) errhandler("Compatible Bitmap Selection", hwnd); // Hide the application window. ShowWindow(hwnd, SW_HIDE); //Copy color data for the entire display into a //bitmap that is selected into a compatible DC. if (!BitBlt(hdcCompatible, 0,0, bmp.bmWidth, bmp.bmHeight, hdcScreen, 0,0, SRCCOPY)) errhandler("Screen to Compat Blt Failed", hwnd); // Redraw the application window. ShowWindow(hwnd, SW_SHOW); http://www.codeproject.com/KB/graphics/screen_capturing.aspx 我想做一个抓屏后然后再传输过去现在我已经实现jpg图片的传输了不过抓屏怎么和它连在一起呀有没有代码呀 使用GDI+将位图转化成JPG:向MFC中增加ATL静态链接#include "atlimage.h"//以下是屏幕的截图CDC dc; dc.CreateDC(_T("DISPLAY"),NULL,NULL,NULL); CBitmap bm; int Width=GetSystemMetrics(SM_CXSCREEN); int Height=GetSystemMetrics(SM_CYSCREEN); bm.CreateCompatibleBitmap(&dc,Width,Height); CDC tdc; tdc.CreateCompatibleDC(&dc); CBitmap* pOld=tdc.SelectObject(&bm); tdc.BitBlt(0,0,Width,Height,&dc,0,0,SRCCOPY); tdc.SelectObject(pOld); //以下是JPG图片的保存 CImage image; image.Attach(bm); image.Save(_T("C:\\My.bmp"),Gdiplus::ImageFormatJPEG);//然后调用CImage的Load方法把JPG读取出来 列表框行数怎么获得? 这个时候发帖提问有木有人来回答啊? 不明白htonl的原理? 求VC++串口通信的例子或源码,请高手赐教!! 请求数据库更新问题??求帮助,谢谢谢谢!!! 多线程文件搜索的问题(第一次进行多线程编程) 晕 MFC出了个奇怪的问题~~~ 急等~~ 怎样获得网站的缺省页面文件名? VC++程序员 兼职实习 西安 VC++bmp图像处理 MDI子窗口激活的问题,大家帮忙啊 急:在MFC classwizzard里的class name列表中看不到已创建的类名 在VC中,一些指针为什么在构造函数中初始化写成NULL,它有什么意义?
类似QQ截屏。
你搜索下“QQ”,就可以找到了。
如果要截播放器 游戏等使用了硬件加速的内容,有点麻烦
// normal DC provides a "snapshot" of the screen contents. The
// memory DC keeps a copy of this "snapshot" in the associated
// bitmap.
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
hdcCompatible = CreateCompatibleDC(hdcScreen);
// Create a compatible bitmap for hdcScreen.
hbmScreen = CreateCompatibleBitmap(hdcScreen,
GetDeviceCaps(hdcScreen, HORZRES),
GetDeviceCaps(hdcScreen, VERTRES));
if (hbmScreen == 0)
errhandler("hbmScreen", hwnd);
// Select the bitmaps into the compatible DC.
if (!SelectObject(hdcCompatible, hbmScreen))
errhandler("Compatible Bitmap Selection", hwnd);
// Hide the application window.
ShowWindow(hwnd, SW_HIDE);
//Copy color data for the entire display into a
//bitmap that is selected into a compatible DC.
if (!BitBlt(hdcCompatible,
0,0,
bmp.bmWidth, bmp.bmHeight,
hdcScreen,
0,0,
SRCCOPY))
errhandler("Screen to Compat Blt Failed", hwnd);
// Redraw the application window.
ShowWindow(hwnd, SW_SHOW);
现在我已经实现jpg图片的传输了不过抓屏怎么和它连在一起呀
有没有代码呀
向MFC中增加ATL静态链接
#include "atlimage.h"
//以下是屏幕的截图
CDC dc;
dc.CreateDC(_T("DISPLAY"),NULL,NULL,NULL);
CBitmap bm;
int Width=GetSystemMetrics(SM_CXSCREEN);
int Height=GetSystemMetrics(SM_CYSCREEN);
bm.CreateCompatibleBitmap(&dc,Width,Height);
CDC tdc;
tdc.CreateCompatibleDC(&dc);
CBitmap* pOld=tdc.SelectObject(&bm);
tdc.BitBlt(0,0,Width,Height,&dc,0,0,SRCCOPY);
tdc.SelectObject(pOld);
//以下是JPG图片的保存
CImage image;
image.Attach(bm);
image.Save(_T("C:\\My.bmp"),Gdiplus::ImageFormatJPEG);
//然后调用CImage的Load方法把JPG读取出来