64,654
社区成员
发帖
与我相关
我的任务
分享
BOOL Role::Draw(HDC m_hdc)
{
static TCHAR temp[100];
static UINT frameCount = 0;
if (frameCount == 4)
frameCount = 0;
CRect rect;
rect.bottom = 103*3;
rect.left = 133*frameCount;
rect.right = 133*(frameCount+1);
rect.top = 103*(2);
cximg->Crop(rect);
cximg->Draw(m_hdc,0,400);
frameCount++;
swprintf_s(temp,L"framecount: %d ,left: %d ,right: %d ", frameCount, rect.left, rect.right);
TextOut(m_hdc, 0, 100, temp, wcslen(temp));
//BitBlt(m_hdc, 0, 400, 133, 103, m_hImgDC, 133*frameCount, 103*3, SRCCOPY);
return TRUE;
}
static CRect rects[4]={
CRect( 0, 0,133,103),
CRect(133, 0,266,103),
CRect( 0,103,133,206),
CRect(133,103,266,206),
}
rect = rects[frameCount];