本文整理汇总了C++中gdiplus::Graphics::DrawLines方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::DrawLines方法的具体用法?C++ Graphics::DrawLines怎么用?C++ Graphics::DrawLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gdiplus::Graphics
的用法示例。
在下文中一共展示了Graphics::DrawLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDrawFace
void CSkyODL::OnDrawFace( Gdiplus::Graphics& gcDrawer, float fScale )
{
CBaseODL::OnDrawFace(gcDrawer, fScale);
Gdiplus::Pen Dot( m_clDotColor, static_cast<Gdiplus::REAL>(1.0 / fScale));
CArray<Gdiplus::Point> st;
CArray<BYTE> stBytes;
for (auto& curItem : m_arrTopPoint)
{
Gdiplus::Point pt;
pt.X = static_cast<INT>(curItem.X());
pt.Y = static_cast<INT>(-curItem.Z());
st.Add(pt);
}
if(st.GetSize()<=0)
{
return;
}
Gdiplus::Pen pen( m_clPenColor, static_cast<Gdiplus::REAL>(1.0 / fScale));
pen.SetDashStyle(Gdiplus::DashStyleSolid);
Gdiplus::HatchBrush brush( Gdiplus::HatchStyle(Gdiplus::HatchStyle::HatchStyleCross ), m_clPenColor, Gdiplus::Color(0,255,255,255) );
//画皮肤
gcDrawer.FillPolygon(&brush, st.GetData(), st.GetSize(), Gdiplus::FillMode::FillModeAlternate);
gcDrawer.DrawLines(&pen, st.GetData(), st.GetSize());
}
示例2: OnDrawTop
void CSkyODL::OnDrawTop(Gdiplus::Graphics& gcDrawer, float fScale)
{
CBaseODL::OnDrawTop(gcDrawer, fScale);
Gdiplus::Pen Dot( m_clDotColor, static_cast<Gdiplus::REAL>(1.0 / fScale));
CArray<Gdiplus::Point> st;
CArray<Gdiplus::Point> stMoving;
CArray<BYTE> stBytes;
for (auto& curItem : m_arrTopPoint)
{
Gdiplus::Point pt;
pt.X = static_cast<INT>(curItem.X());
pt.Y = static_cast<INT>(curItem.Z());
st.Add(pt);
}
if (IsTopMoving())
{
for ( auto& curMoving : m_arrMovingTopPoint )
{
Gdiplus::Point pt;
pt.X = static_cast<INT>(curMoving.X());
pt.Y = static_cast<INT>(curMoving.Z());
stMoving.Add(pt);
}
}
if(st.GetSize()<=0)
{
return;
}
for (int i=0; i<st.GetSize(); ++i)
{
st[i].X = static_cast<INT>(st[i].X);
st[i].Y = static_cast<INT>(st[i].Y);
}
for (int i=0; i<stMoving.GetSize(); ++i)
{
stMoving[i].X = static_cast<INT>(stMoving[i].X);
stMoving[i].Y = static_cast<INT>(stMoving[i].Y);
}
Gdiplus::Pen pen( m_clPenColor, static_cast<Gdiplus::REAL>(1.0 / fScale));
pen.SetDashStyle(Gdiplus::DashStyleSolid);
if (!IsTopCreating())
{
Gdiplus::HatchBrush brush( Gdiplus::HatchStyle(Gdiplus::HatchStyle::HatchStyleCross ), m_clPenColor, Gdiplus::Color(0,255,255,255) );
//画皮肤
gcDrawer.FillPolygon(&brush, st.GetData(), st.GetSize(), Gdiplus::FillMode::FillModeAlternate);
}
gcDrawer.DrawLines(&pen, st.GetData(), st.GetSize());
if (IsTopMoving())
{
Gdiplus::Pen penMoving( m_clDotColor, static_cast<Gdiplus::REAL>(1.0 / fScale));
penMoving.SetDashStyle( Gdiplus::DashStyleSolid);
gcDrawer.DrawLines(&penMoving, stMoving.GetData(), stMoving.GetSize());
}
if (IsTopSelected())
{
//每个转角画一个点
for (int x=0; x<st.GetSize(); x++)
{
gcDrawer.DrawRectangle(&Dot, (st[x].X) - 3.0f/fScale, (st[x].Y ) - 3.0f/fScale, 6.0f/fScale, 6.0f/fScale);
}
}
}