本文整理汇总了C++中Pen::SetDashStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ Pen::SetDashStyle方法的具体用法?C++ Pen::SetDashStyle怎么用?C++ Pen::SetDashStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pen
的用法示例。
在下文中一共展示了Pen::SetDashStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gdipColor
static Pen * gdiplusCreatePen(UINT style, float width, COLORREF color)
{
// create GDI+ pen
Color gdipColor(0, 0, 0, 255);
gdipColor.SetFromCOLORREF(color);
Pen * pen = new Pen(gdipColor, width > 1 ? width : 1);
if (style <= PS_DASHDOTDOT)
// cast is save since GDI and GDI+ use same numbers
pen->SetDashStyle(static_cast<DashStyle>(style));
pen->SetLineCap(LineCapFlat, LineCapFlat, DashCapFlat);
return pen;
}
示例2: DrawPolygon
void DrawPolygon(const Point* points, IN INT count, HDC hdcPaint, DashStyle dashStyle, Color clr, REAL width)
{
Pen* myPen;
Graphics* myGraphics;
myPen = new Pen(clr, width);
if(myPen)
{
myPen->SetDashStyle(dashStyle);
myGraphics = new Graphics(hdcPaint);
if(myGraphics)
{
myGraphics->DrawPolygon(myPen, points, count);
delete myGraphics;
}
delete myPen;
}
}
示例3: DrawLine
void DrawLine(const Point &pt1, const Point &pt2, HDC hdcPaint, DashStyle dashStyle, Color clr, REAL width)
{
Pen* myPen;
Graphics* myGraphics;
myPen = new Pen(clr, width);
if(myPen)
{
myPen->SetDashStyle(dashStyle);
myGraphics = new Graphics(hdcPaint);
if(myGraphics)
{
myGraphics->DrawLine(myPen, pt1, pt2);
delete myGraphics;
}
delete myPen;
}
}
示例4: DrawRect
void DrawRect(LPRECT prc, HDC hdcPaint, DashStyle dashStyle, Color clr, REAL width)
{
Pen* myPen;
Graphics* myGraphics;
myPen = new Pen(clr, width);
if(myPen)
{
myPen->SetDashStyle(dashStyle);
myGraphics = new Graphics(hdcPaint);
if(myGraphics)
{
myGraphics->DrawRectangle(myPen, prc->left, prc->top,
prc->right - 1 - prc->left, prc->bottom - 1 - prc->top);
delete myGraphics;
}
delete myPen;
}
}