Пример #1
0
void CTransparentPen::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	Pen penDraw(m_crColor);
	penDraw.SetStartCap(LineCapRound);
	penDraw.SetEndCap(LineCapRound);
	penDraw.SetLineJoin(LineJoinRound);
	penDraw.SetWidth(m_nWidth * m_fScale);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount,0.8f);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
Пример #2
0
void CFlatBrushPen::SetRegion()
{
	ASSERT(m_bFinish);
	PointF* pPt = m_ptary.GetData();
	float fwidth = m_nWidth * m_fScale;

	Pen penDraw(m_crColor, fwidth);
	penDraw.ScaleTransform(1, 2.0f / fwidth, MatrixOrderAppend);
	penDraw.RotateTransform(m_ftransAngle, MatrixOrderAppend);

	GraphicsPath path;
	path.AddCurve(pPt, m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
Пример #3
0
void CNormalPen::SetRegion()
{
	ASSERT(m_bFinish);
	PointF* pPt = m_ptary.GetData();
	Pen penDraw(m_crColor);
	penDraw.SetWidth(m_nWidth * m_fScale);

	penDraw.SetEndCap(m_nEndCap);
	penDraw.SetStartCap(m_nStartCap);
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetLineJoin(LineJoinRound);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
Пример #4
0
void CNormalPen::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	int nWidth = m_nWidth;
	if(m_nWidth < 3)
	{
		nWidth = 3;
	}

	Pen penDraw(m_crColor,(float)nWidth);
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetStartCap(m_nStartCap);
	penDraw.SetEndCap(m_nEndCap);
	penDraw.SetLineJoin(LineJoinRound);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}