1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| bool RotateAnimation::DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl) { Gdiplus::PointF centerPos(m_rcItem.left + GetWidth()/ 2, m_rcItem.top + GetHeight()/ 2);
Gdiplus::Graphics graphics(hDC);
graphics.TranslateTransform(centerPos.X, centerPos.Y); graphics.RotateTransform(m_fCurAngle); graphics.TranslateTransform(-centerPos.X, -centerPos.Y);
const TImageInfo* imgInfo = GetManager()->GetImageEx(m_diBk.sImageName); BITMAP bmp; GetObject(imgInfo->hBitmap, sizeof(BITMAP), &bmp); Gdiplus::Bitmap gdi_bmp(imgInfo->nX, imgInfo->nY, imgInfo->nX * 4, PixelFormat32bppPARGB, (BYTE*)bmp.bmBits); graphics.DrawImage(&gdi_bmp, m_rcItem.left, m_rcItem.top, GetWidth(), GetHeight()); return true; } }
|