16,472
社区成员
发帖
与我相关
我的任务
分享
int Wuti::tietu(CPoint point, UINT leixing, CDC* pDC)
{
CBrush bru;
bru.CreateSolidBrush(RGB(255,255,255));
if (leixing==-2)
{
switch(m_fangxing)
{
case 2:
pDC->FillRect(CRect(m_rect.left,m_rect.bottom-2,m_rect.right,m_rect.bottom),&bru);
break;
case 3:
pDC->FillRect(CRect(m_rect.left,m_rect.top,m_rect.left+2,m_rect.bottom),&bru);
break;
case 0:
pDC->FillRect(CRect(m_rect.left,m_rect.top,m_rect.right,m_rect.top+2),&bru);
break;
case 1:
pDC->FillRect(CRect(m_rect.right-2,m_rect.top,m_rect.right,m_rect.bottom),&bru);
break;
}
}
if (leixing==-1)
{
switch(m_fangxing)
{
case 0:
pDC->FillRect(CRect(m_rect.left,m_rect.bottom-4,m_rect.right,m_rect.bottom),&bru);
break;
case 1:
pDC->FillRect(CRect(m_rect.left,m_rect.top,m_rect.left+4,m_rect.bottom),&bru);
break;
case 2:
pDC->FillRect(CRect(m_rect.left,m_rect.top,m_rect.right,m_rect.top+4),&bru);
break;
case 3:
pDC->FillRect(CRect(m_rect.right-4,m_rect.top,m_rect.right,m_rect.bottom),&bru);
break;
}
}
if (leixing==0)
{
CDC beijingdc;
beijingdc.CreateCompatibleDC(pDC);
beijingdc.SelectObject(m_bitbeijing);
pDC->BitBlt(m_rect.left-2,m_rect.top-2,m_rect.right-m_rect.left+4,m_rect.bottom-m_rect.top+4,&beijingdc,0,0,SRCPAINT);
pDC->BitBlt(m_rect.left-2,m_rect.top-2,m_rect.right-m_rect.left+4,m_rect.bottom-m_rect.top+4,&beijingdc,0,0,SRCAND);
DeleteDC(beijingdc);
return 0;
}
CDC dc,dcd;
dc.CreateCompatibleDC(pDC);
dcd.CreateCompatibleDC(pDC);
dc.SelectObject(m_bit);
dcd.SelectObject(m_kongbai);
dc.SetBkColor(RGB(0,0,255));
dcd.BitBlt(0,0,448,512,&dc,0,0,SRCCOPY);
if (leixing==WU_GUAI)
{
if (m_left<=2)
{
if (m_itietu/3%2==0)
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left+1)%2),112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left+1)%2),112+28*m_fangxing,SRCPAINT);
}
else
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left+1)%2)+28,112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left+1)%2)+28,112+28*m_fangxing,SRCPAINT);
}
}
else
{
if (m_zhonglei==1||m_zhonglei==0)
{
if (m_itietu/3%2==0)
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left+1)%2),112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left+1)%2),112+28*m_fangxing,SRCPAINT);
}
else
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left)%2)+28,112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left)%2)+28,112+28*m_fangxing,SRCPAINT);
}
}
if (m_zhonglei==2)
{
if (m_itietu/3%2==0)
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left+1)%2)+112,112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left+1)%2)+112,112+28*m_fangxing,SRCPAINT);
}
else
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,112*m_zhonglei+56*((m_left)%2)+112+28,112+28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,112*m_zhonglei+56*((m_left)%2)+112+28,112+28*m_fangxing,SRCPAINT);
}
}
}
m_itietu++;
}
if (leixing==WU_RENWU)
{
if (m_itietu/3%2==0)
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,56*m_zhonglei,28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,56*m_zhonglei,28*m_fangxing,SRCPAINT);
}
else
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,56*m_zhonglei+28,28*m_fangxing,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,56*m_zhonglei+28,28*m_fangxing,SRCPAINT);
}
if (m_yidong==true)
{
m_itietu++;
}
}
if (leixing==WU_ZIDAN)
{
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dcd,249,257,SRCCOPY);
pDC->BitBlt(m_rect.left,m_rect.top,m_rect.right-m_rect.left,m_rect.bottom-m_rect.top,&dc,249,257,SRCPAINT);
}
DeleteObject(bru);
DeleteDC(dc);
DeleteDC(dcd);
return 0;
}
这是我贴图的代码。