本文整理汇总了C++中JPainter::DrawDashedLines方法的典型用法代码示例。如果您正苦于以下问题:C++ JPainter::DrawDashedLines方法的具体用法?C++ JPainter::DrawDashedLines怎么用?C++ JPainter::DrawDashedLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPainter
的用法示例。
在下文中一共展示了JPainter::DrawDashedLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ellipseRect
//.........这里部分代码省略.........
p.SetFontName("Times");
p.SetFontStyle(colormap->GetBlueColor());
p.String( 0.0, textPt, "Hello");
p.String( 90.0, textPt, "Hello");
p.SetFontStyle(colormap->GetYellowColor());
p.String(180.0, textPt, "Hello");
p.String(270.0, textPt, "Hello");
p.SetPenColor(colormap->GetYellowColor());
r.Set(0,11,80,91);
p.Rect(r);
r.Shrink(1,1);
p.SetPenColor(colormap->GetBlueColor());
p.Ellipse(r);
r.Shrink(1,1);
p.SetPenColor(colormap->GetRedColor());
p.Arc(r, 270.0-45.0, -270.0);
JPolygon poly;
poly.AppendElement(JPoint(0,85));
poly.AppendElement(JPoint(10,85));
poly.AppendElement(JPoint(5,95));
p.Polygon(poly);
p.Line(0,100, 2,98);
p.LineTo(4,100);
p.LineTo(2,102);
p.LineTo(0,100);
poly.SetElement(1, JPoint(0,5));
poly.SetElement(2, JPoint(2,0));
poly.SetElement(3, JPoint(4,5));
p.Polygon(2,105, poly);
// test filling rule
p.SetPenColor(colormap->GetRedColor());
p.SetFilling(kJTrue);
JPolygon fillRulePoly;
fillRulePoly.AppendElement(JPoint(175,45));
fillRulePoly.AppendElement(JPoint(165,65));
fillRulePoly.AppendElement(JPoint(190,50));
fillRulePoly.AppendElement(JPoint(160,50));
fillRulePoly.AppendElement(JPoint(185,65));
p.Polygon(fillRulePoly);
p.SetFilling(kJFalse);
// dashed lines
p.DrawDashedLines(kJTrue);
p.SetPenColor(colormap->GetBlackColor());
JArray<JSize> dashList; // pixel rulers
dashList.AppendElement(1);
dashList.AppendElement(1);
p.SetDashList(dashList);
p.Line(100,110, 200,110);
p.Line(100,114, 200,114);
p.Line(100,118, 200,118);
dashList.SetElement(1, 2); // simple pattern
dashList.SetElement(2, 3);
p.SetDashList(dashList);
p.Line(100,112, 200,112);
p.SetFontStyle(JFontStyle(kJFalse, kJFalse, 1, kJFalse));
p.String(130,155, "underline without dashes");
p.SetDashList(dashList, 3); // test offset
p.Line(100,116, 200,116);
dashList.SetElement(1, 1); // example with odd # of values from X manuals
dashList.SetElement(2, 2);
dashList.AppendElement(3);
p.SetDashList(dashList);
p.Line(100,120, 200,120);
dashList.SetElement(1, 5); // dash-dot pattern
dashList.SetElement(2, 2);
dashList.SetElement(3, 1);
dashList.AppendElement(2);
p.SetDashList(dashList);
p.Line(100,122, 200,122);
p.Ellipse(210,110, 20,20);
p.DrawDashedLines(kJFalse);
p.Ellipse(213,113, 14,14);
p.Rect(207,107, 26,26);
p.SetPenColor(colormap->GetYellowColor());
p.DrawDashedLines(kJTrue);
p.Ellipse(213,113, 14,14);
// icons
p.Image(*itsXPMImage, itsXPMImage->GetBounds(), 33,110);
p.Image(*itsPartialXPMImage, itsXPMImage->GetBounds(), 50,121);
}
示例2: ellipseRect
//.........这里部分代码省略.........
JPolygon poly;
poly.AppendElement(JPoint(0,85));
poly.AppendElement(JPoint(10,85));
poly.AppendElement(JPoint(5,95));
p.Polygon(poly);
p.Line(0,100, 2,98);
p.LineTo(4,100);
p.LineTo(2,102);
p.LineTo(0,100);
poly.SetElement(1, JPoint(0,5));
poly.SetElement(2, JPoint(2,0));
poly.SetElement(3, JPoint(4,5));
p.Polygon(2,105, poly);
// test filling rule
p.SetPenColor(colormap->GetRedColor());
p.SetFilling(kJTrue);
JPolygon fillRulePoly;
fillRulePoly.AppendElement(JPoint(175,45));
fillRulePoly.AppendElement(JPoint(165,65));
fillRulePoly.AppendElement(JPoint(190,50));
fillRulePoly.AppendElement(JPoint(160,50));
fillRulePoly.AppendElement(JPoint(185,65));
p.Polygon(fillRulePoly);
p.SetFilling(kJFalse);
// dashed lines
p.DrawDashedLines(kJTrue);
p.SetPenColor(colormap->GetBlackColor());
JArray<JSize> dashList; // pixel rulers
dashList.AppendElement(1);
dashList.AppendElement(1);
p.SetDashList(dashList);
p.Line(100,110, 200,110);
p.Line(100,114, 200,114);
p.Line(100,118, 200,118);
dashList.SetElement(1, 2); // simple pattern
dashList.SetElement(2, 3);
p.SetDashList(dashList);
p.Line(100,112, 200,112);
p.SetFontStyle(JFontStyle(kJFalse, kJFalse, 1, kJFalse));
p.String(130,155, "underline without dashes");
p.SetDashList(dashList, 3); // test offset
p.Line(100,116, 200,116);
dashList.SetElement(1, 1); // example with odd # of values from X manuals
dashList.SetElement(2, 2);
dashList.AppendElement(3);
p.SetDashList(dashList);
p.Line(100,120, 200,120);
dashList.SetElement(1, 5); // dash-dot pattern
dashList.SetElement(2, 2);
dashList.SetElement(3, 1);
dashList.AppendElement(2);