这个代码能否转为AU3的?这么短的代码画的图看起来很不错啊。void CRotateAnimation::DrawPie(HDC hDC)
{
Gdiplus::Graphics* pGraphics=new Gdiplus::Graphics(hDC);
pGraphics->SetSmoothingMode(SmoothingModeHighQuality);
Gdiplus::Color clr(150,0,0,0);
Gdiplus::SolidBrush* pBrush=new Gdiplus::SolidBrush(clr);
//--------------------------------------------------------
//计算外圈、内圈位置
Gdiplus::Rect rcOut(m_Rect);
Gdiplus::Rect rcIn(rcOut);
rcIn.Inflate(-m_ItemSize,-m_ItemSize);
//--------------------------------------------------------
//先画出外圈小方块
float fStartAngle = -90;//起始绘制角度
float fSweepAngle = 360 / m_AnimationCount;//每小块的角度
for(int i=0;i<m_AnimationCount;i++)
{
clr.SetFromCOLORREF(m_pAnimationArray[i].clrOut);
pBrush->SetColor(clr);
pGraphics->FillPie(pBrush,rcOut, fStartAngle, fSweepAngle - m_MarginAngle);
fStartAngle = fStartAngle + fSweepAngle;
}
//--------------------------------------------------------
//画出内圈小方块;
fStartAngle = -90;
for(int i=0;i<m_AnimationCount;i++)
{
clr.SetFromCOLORREF(m_pAnimationArray[i].clrIn);
pBrush->SetColor(clr);
pGraphics->FillPie(pBrush,rcIn, fStartAngle, fSweepAngle - m_MarginAngle);
fStartAngle = fStartAngle + fSweepAngle;
}
//--------------------------------------------------------
//画出中间圆心,用控件底色填充
rcIn.Inflate(-m_ItemSize,-m_ItemSize);
clr.SetFromCOLORREF(m_ColorBack);
pBrush->SetColor(clr);
pGraphics->FillEllipse(pBrush,rcIn);
//--------------------------------------------------------
delete pBrush;
delete pGraphics;
}
http://blog.csdn.net/CometNet/article/details/53363596 |