GraphicsPath * pPath = MakeRoundRect(Point(0, 0), Point(300, 300), m_Slider.GetPos());
GraphicsPath* MakeRoundRect(Point topLeft, Point bottomRight, INT percentageRounded)
{
ASSERT (percentageRounded >= 1 && percentageRounded <= 100); INT left = min(topLeft.X, bottomRight.X);
INT right = max(topLeft.X, bottomRight.X); INT top = min(topLeft.Y, bottomRight.Y);
INT bottom = max(topLeft.Y, bottomRight.Y); INT offsetX = (right-left)*percentageRounded/100;
INT offsetY = (bottom-top)*percentageRounded/100; GraphicsPath pt;
GraphicsPath * path = pt.Clone(); path->AddArc(right-offsetX, top, offsetX, offsetY, 270, 90);
path->AddArc(right-offsetX, bottom-offsetY, offsetX, offsetY, 0, 90); path->AddArc(left, bottom - offsetY, offsetX, offsetY, 90, 90); path->AddArc(left, top, offsetX, offsetY, 180, 90); path->AddLine(left + offsetX, top, right - offsetX/2, top); return path;
}
GraphicsPath* MakeRoundRect(Point topLeft, Point bottomRight, INT percentageRounded)
{
ASSERT (percentageRounded >= 1 && percentageRounded <= 100); INT left = min(topLeft.X, bottomRight.X);
INT right = max(topLeft.X, bottomRight.X); INT top = min(topLeft.Y, bottomRight.Y);
INT bottom = max(topLeft.Y, bottomRight.Y); INT offsetX = (right-left)*percentageRounded/100;
INT offsetY = (bottom-top)*percentageRounded/100; GraphicsPath pt;
GraphicsPath * path = pt.Clone(); path->AddArc(right-offsetX, top, offsetX, offsetY, 270, 90);
path->AddArc(right-offsetX, bottom-offsetY, offsetX, offsetY, 0, 90); path->AddArc(left, bottom - offsetY, offsetX, offsetY, 90, 90); path->AddArc(left, top, offsetX, offsetY, 180, 90); path->AddLine(left + offsetX, top, right - offsetX/2, top); return path;
}
中怎么搜索RoundRect函数
path->AddArc(right-offsetX, top, offsetX, offsetY, 270, 90);
path->AddArc(right-offsetX, bottom-offsetY, offsetX, offsetY, 0, 90);
path->AddArc(left, bottom - offsetY, offsetX, offsetY, 90, 90);
path->AddArc(left, top, offsetX, offsetY, 180, 90);
path->AddLine(left + offsetX, top, right - offsetX/2, top);
//什么意思???????????????
这个我上次和你说要使用SourceInsight这个编辑器