18,356
社区成员
发帖
与我相关
我的任务
分享
CatchScrBmp(); //先捕获屏幕位图结构和数据,即得到m_bmpBit,和m_pBmpData
//发送位图结构信息
int nSend = send(m_hSocket, (char *)&m_bmpBit, sizeof(m_bmpBit), 0);
//发送位图数据信息
int nBytesSent = 0;
int nBytesThisTime = 0;
char *pch = m_pBmpData;
int size = m_bmpBit.bmWidthBytes * m_bmpBit.bmHeight;
do{
if(m_bEndVideo == true) //结束传送桌面画面线程
break;//发送大量的数据时 采用循环 直到发送完要发送的数据为止
nBytesThisTime = send(m_hSocket, pch, size - nBytesSent, 0);
nBytesSent += nBytesThisTime;
pch += nBytesThisTime;
}while(nBytesSent < size);