void CMy234Dlg::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
HDC hdc;
char inStr[36];
unsigned char inStr2[36];
COLORREF n_colour =0x0ff0000;
unsigned short x,y,m_colour;
unsigned int pix;
CString str("OK");
LPCTSTR p = (LPCTSTR)str;
while ( 0!=tcp_client());
while (1)
{
hdc =::GetDC(m_hWnd);
recv(s, inStr, sizeof(inStr), 0);
for (int i=0;i<36;i++)
{
inStr2[i] =(unsigned char )inStr[i];
}
if ((unsigned char)(inStr2[28]) == 0x88) //ÊÇÏà»úÊý¾Ý
{
//»ñÈ¡Æðʼµãx,y×ø±ê
//MessageBox(str);
pix=inStr2[29]+inStr2[30]*256+inStr2[31]*65536;
for (int i=0;i<13;i++)
{
y=pix/240;
x= pix%320;
m_colour = inStr2[(13-i)*2]+256*inStr2[(13-i)*2+1];
change_color(&m_colour,&n_colour);
SetPixel(hdc,x+20,y+20,n_colour);
pix--;
}
}
}
//walt- OnOK();
}
{
// TODO: Add your control notification handler code here
HDC hdc;
char inStr[36];
unsigned char inStr2[36];
COLORREF n_colour =0x0ff0000;
unsigned short x,y,m_colour;
unsigned int pix;
CString str("OK");
LPCTSTR p = (LPCTSTR)str;
while ( 0!=tcp_client());
while (1)
{
hdc =::GetDC(m_hWnd);
recv(s, inStr, sizeof(inStr), 0);
for (int i=0;i<36;i++)
{
inStr2[i] =(unsigned char )inStr[i];
}
if ((unsigned char)(inStr2[28]) == 0x88) //ÊÇÏà»úÊý¾Ý
{
//»ñÈ¡Æðʼµãx,y×ø±ê
//MessageBox(str);
pix=inStr2[29]+inStr2[30]*256+inStr2[31]*65536;
for (int i=0;i<13;i++)
{
y=pix/240;
x= pix%320;
m_colour = inStr2[(13-i)*2]+256*inStr2[(13-i)*2+1];
change_color(&m_colour,&n_colour);
SetPixel(hdc,x+20,y+20,n_colour);
pix--;
}
}
}
//walt- OnOK();
}