GDI画旋转图片

时间:2016-12-10 15:24:25
【文件属性】:
文件名称:GDI画旋转图片
文件大小:131KB
文件格式:RAR
更新时间:2016-12-10 15:24:25
旋转图片 通过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;
【文件预览】:
TransFormTest
----TransFormTest()
--------TransFormTestDlg.cpp(6KB)
--------TransFormTest.vcproj.VRGROUP.xiejingan.user(1KB)
--------resource.h(731B)
--------Debug()
--------TransFormTestDlg.h(925B)
--------TransFormTest.aps(57KB)
--------TransFormTest.cpp(2KB)
--------stdafx.h(2KB)
--------ReadMe.txt(3KB)
--------res()
--------TransFormTest.rc(5KB)
--------stdafx.cpp(144B)
--------TransFormTest.h(483B)
--------TransFormTest.vcproj(5KB)
----TransFormTest.suo(27KB)
----debug()
----TransFormTest.sln(904B)

网友评论