jout << (uint8)UMR_START_BOARDCAST;
char buf[1024] = {0};
jout.getbuf(buf);
map<int, CLIENT_INFO>::const_iterator map_it = client_map.begin();
while (map_it != client_map.end())
{
sendto(udpSocket,buf,jout.length(),0,(sockaddr*)&map_it->second.addr,sizeof(map_it->second.addr)); //发送屏幕信息数据包
++map_it;
SendFile(this);
SetTimer(1,2000,NULL);
}
}
void CMY_UdpIocpSrvDlg::OnTimer(UINT nIDEvent)
{
//定时器实现函数
// TODO: Add your message handler code here and/or call default
GrabScreen();
SaveBitmapToFile(m_hbmScreen,"C:\\1.bmp");
m_hSocket=NULL;
InitSock();//初始化socket
CFileFind find;
if(!find.FindFile(m_strPathName))
{
MessageBox("文件路径无效","提醒");
return;
}
SendFile(this);
CDialog::OnTimer(nIDEvent);
}
(4)客户端接收服务器发送的位图并全屏显示
void CScreenDlg::ShowPIC(char* buf,int iSize)
{
//显示缓存位图
if(iSize==0||buf==NULL) return;
ASSERT(buf!=NULL);
CDC *pDC=m_cImage.GetDC();
ASSERT(pDC!=NULL);
CPicture pic;
pic.Load(buf,iSize);
CRect rect;
m_cImage.GetClientRect(&rect);
rect.top+=15;本文来自优.文~论^文·网原文请找腾讯324,9114
rect.left+=5;
rect.right-=5;
rect.bottom-=5;
pic.Render(pDC,rect);
}
void CScreenDlg::RevFile(const SOCKET& s)
<< 上一页 [21] [22] 下一页
C++的多媒体屏幕广播教学系统设计 第21页下载如图片无法显示或论文不完整,请联系qq752018766