通过GDI在窗口上画不同角度旋转的图片,
Graphics* graphics = Graphics::FromHDC(dc.m_hDC);
float width = (float)tmpWidth / graphics->GetDpiX()*25.4f;
float height = (float)tmpHeight / graphics->GetDpiY()*25.4f;
Gdiplus::Bitmap tmpBmp( tmpWidth+600,tmpHeight+400);
Gdiplus::Graphics *gTmp = Gdiplus::Graphics::FromImage(&tmpBmp);
gTmp->SetPageUnit(Gdiplus::UnitMillimeter);
gTmp->TranslateTransform(width/2.0f,height);
gTmp->RotateTransform(m_SliderVal);
gTmp->TranslateTransform(-width/2.0f,-height);
gTmp->DrawImage(m_pngFile,0.0f,0.0f,width,height);
graphics->DrawImage(&tmpBmp,100.0f,100.0f,(float)tmpWidth+600,(float)tmpHeight+400);
delete gTmp;
评论0
最新资源