Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
6.5 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: CInsetLines.cpp
  3. *
  4. * This file contains the code to support the functionality test harness
  5. * for GDI+. This includes menu options and calling the appropriate
  6. * functions for execution.
  7. *
  8. * Created: 05-May-2000 - Jeff Vezina [t-jfvez]
  9. *
  10. * Copyright (c) 2000 Microsoft Corporation
  11. *
  12. \**************************************************************************/
  13. #include "CInsetLines.h"
  14. CInsetLines::CInsetLines(BOOL bRegression)
  15. {
  16. strcpy(m_szName,"Lines : Inset Pen");
  17. m_bRegression=bRegression;
  18. }
  19. void CInsetLines::Draw(Graphics *g)
  20. {
  21. INT count = 5;
  22. BYTE t[] = {0x00, 0x01, 0x01, 0x01, 0x81};
  23. PointF p[5];
  24. p[0].X = 104.0f/450.0f*TESTAREAWIDTH; p[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  25. p[1].X = 379.0f/450.0f*TESTAREAWIDTH; p[1].Y = 97.0f/450.0f*TESTAREAHEIGHT;
  26. p[2].X = 385.0f/450.0f*TESTAREAWIDTH; p[2].Y = 355.0f/450.0f*TESTAREAHEIGHT;
  27. p[3].X = 249.0f/450.0f*TESTAREAWIDTH; p[3].Y = 47.0f/450.0f*TESTAREAHEIGHT;
  28. p[4].X = 109.0f/450.0f*TESTAREAWIDTH; p[4].Y = 350.0f/450.0f*TESTAREAHEIGHT;
  29. PointF p1[5];
  30. p1[0].X = 120.0f/450.0f*TESTAREAWIDTH; p1[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  31. p1[1].X = 362.0f/450.0f*TESTAREAWIDTH; p1[1].Y = 64.0f/450.0f*TESTAREAHEIGHT;
  32. p1[2].X = 383.0f/450.0f*TESTAREAWIDTH; p1[2].Y = 395.0f/450.0f*TESTAREAHEIGHT;
  33. p1[3].X = 92.0f/450.0f*TESTAREAWIDTH; p1[3].Y = 394.0f/450.0f*TESTAREAHEIGHT;
  34. p1[4].X = 447.0f/450.0f*TESTAREAWIDTH; p1[4].Y = 243.0f/450.0f*TESTAREAHEIGHT;
  35. GraphicsPath* path = new GraphicsPath(p1, t, count);
  36. path->CloseFigure();
  37. path->AddLine(50, 100, 150, 150);
  38. Color blackColor(0, 0, 0);
  39. SolidBrush brush(blackColor);
  40. REAL width = 10;
  41. Pen pen(&brush, width);
  42. pen.SetAlignment(PenAlignmentInset);
  43. g->DrawPath(&pen, path);
  44. delete path;
  45. }
  46. CInset2::CInset2(BOOL bRegression)
  47. {
  48. strcpy(m_szName,"Lines : Inset Pen, Dash");
  49. m_bRegression=bRegression;
  50. }
  51. void CInset2::Draw(Graphics *g)
  52. {
  53. INT count = 5;
  54. BYTE t[] = {0x00, 0x01, 0x01, 0x01, 0x81};
  55. PointF p[5];
  56. p[0].X = 104.0f/450.0f*TESTAREAWIDTH; p[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  57. p[1].X = 379.0f/450.0f*TESTAREAWIDTH; p[1].Y = 97.0f/450.0f*TESTAREAHEIGHT;
  58. p[2].X = 385.0f/450.0f*TESTAREAWIDTH; p[2].Y = 355.0f/450.0f*TESTAREAHEIGHT;
  59. p[3].X = 249.0f/450.0f*TESTAREAWIDTH; p[3].Y = 47.0f/450.0f*TESTAREAHEIGHT;
  60. p[4].X = 109.0f/450.0f*TESTAREAWIDTH; p[4].Y = 350.0f/450.0f*TESTAREAHEIGHT;
  61. PointF p1[5];
  62. p1[0].X = 120.0f/450.0f*TESTAREAWIDTH; p1[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  63. p1[1].X = 362.0f/450.0f*TESTAREAWIDTH; p1[1].Y = 64.0f/450.0f*TESTAREAHEIGHT;
  64. p1[2].X = 383.0f/450.0f*TESTAREAWIDTH; p1[2].Y = 395.0f/450.0f*TESTAREAHEIGHT;
  65. p1[3].X = 92.0f/450.0f*TESTAREAWIDTH; p1[3].Y = 394.0f/450.0f*TESTAREAHEIGHT;
  66. p1[4].X = 447.0f/450.0f*TESTAREAWIDTH; p1[4].Y = 243.0f/450.0f*TESTAREAHEIGHT;
  67. GraphicsPath* path = new GraphicsPath(p1, t, count);
  68. path->CloseFigure();
  69. path->AddLine(50, 100, 150, 150);
  70. Color blackColor(0, 0, 0);
  71. SolidBrush brush(blackColor);
  72. REAL width = 10.0f;
  73. Pen pen(&brush, width);
  74. pen.SetAlignment(PenAlignmentInset);
  75. pen.SetDashStyle(DashStyleDashDot);
  76. pen.SetDashCap(DashCapRound);
  77. g->DrawPath(&pen, path);
  78. delete path;
  79. }
  80. CInset3::CInset3(BOOL bRegression)
  81. {
  82. strcpy(m_szName,"Lines : Inset Pen, Compound");
  83. m_bRegression=bRegression;
  84. }
  85. void CInset3::Draw(Graphics *g)
  86. {
  87. INT count = 5;
  88. BYTE t[] = {0x00, 0x01, 0x01, 0x01, 0x81};
  89. PointF p[5];
  90. p[0].X = 104.0f/450.0f*TESTAREAWIDTH; p[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  91. p[1].X = 379.0f/450.0f*TESTAREAWIDTH; p[1].Y = 97.0f/450.0f*TESTAREAHEIGHT;
  92. p[2].X = 385.0f/450.0f*TESTAREAWIDTH; p[2].Y = 355.0f/450.0f*TESTAREAHEIGHT;
  93. p[3].X = 249.0f/450.0f*TESTAREAWIDTH; p[3].Y = 47.0f/450.0f*TESTAREAHEIGHT;
  94. p[4].X = 109.0f/450.0f*TESTAREAWIDTH; p[4].Y = 350.0f/450.0f*TESTAREAHEIGHT;
  95. PointF p1[5];
  96. p1[0].X = 120.0f/450.0f*TESTAREAWIDTH; p1[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  97. p1[1].X = 362.0f/450.0f*TESTAREAWIDTH; p1[1].Y = 64.0f/450.0f*TESTAREAHEIGHT;
  98. p1[2].X = 383.0f/450.0f*TESTAREAWIDTH; p1[2].Y = 395.0f/450.0f*TESTAREAHEIGHT;
  99. p1[3].X = 92.0f/450.0f*TESTAREAWIDTH; p1[3].Y = 394.0f/450.0f*TESTAREAHEIGHT;
  100. p1[4].X = 447.0f/450.0f*TESTAREAWIDTH; p1[4].Y = 243.0f/450.0f*TESTAREAHEIGHT;
  101. GraphicsPath* path = new GraphicsPath(p1, t, count);
  102. path->CloseFigure();
  103. path->AddLine(50, 100, 150, 150);
  104. Color blackColor(0, 0, 0);
  105. SolidBrush brush(blackColor);
  106. REAL width = 10.0f;
  107. Pen pen(&brush, width);
  108. pen.SetAlignment(PenAlignmentInset);
  109. float carray[4] = { 0.0f, 0.3f, 0.5f, 1.0f };
  110. pen.SetCompoundArray(carray, 4);
  111. g->DrawPath(&pen, path);
  112. delete path;
  113. }
  114. CInset4::CInset4(BOOL bRegression)
  115. {
  116. strcpy(m_szName,"Lines : Compound, Dash");
  117. m_bRegression=bRegression;
  118. }
  119. void CInset4::Draw(Graphics *g)
  120. {
  121. INT count = 5;
  122. BYTE t[] = {0x00, 0x01, 0x01, 0x01, 0x81};
  123. PointF p[5];
  124. p[0].X = 104.0f/450.0f*TESTAREAWIDTH; p[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  125. p[1].X = 379.0f/450.0f*TESTAREAWIDTH; p[1].Y = 97.0f/450.0f*TESTAREAHEIGHT;
  126. p[2].X = 385.0f/450.0f*TESTAREAWIDTH; p[2].Y = 355.0f/450.0f*TESTAREAHEIGHT;
  127. p[3].X = 249.0f/450.0f*TESTAREAWIDTH; p[3].Y = 47.0f/450.0f*TESTAREAHEIGHT;
  128. p[4].X = 109.0f/450.0f*TESTAREAWIDTH; p[4].Y = 350.0f/450.0f*TESTAREAHEIGHT;
  129. PointF p1[5];
  130. p1[0].X = 120.0f/450.0f*TESTAREAWIDTH; p1[0].Y = 98.0f/450.0f*TESTAREAHEIGHT;
  131. p1[1].X = 362.0f/450.0f*TESTAREAWIDTH; p1[1].Y = 64.0f/450.0f*TESTAREAHEIGHT;
  132. p1[2].X = 383.0f/450.0f*TESTAREAWIDTH; p1[2].Y = 395.0f/450.0f*TESTAREAHEIGHT;
  133. p1[3].X = 92.0f/450.0f*TESTAREAWIDTH; p1[3].Y = 394.0f/450.0f*TESTAREAHEIGHT;
  134. p1[4].X = 447.0f/450.0f*TESTAREAWIDTH; p1[4].Y = 243.0f/450.0f*TESTAREAHEIGHT;
  135. GraphicsPath* path = new GraphicsPath(p1, t, count);
  136. path->CloseFigure();
  137. path->AddLine(50, 100, 150, 150);
  138. Color blackColor(0, 0, 0);
  139. SolidBrush brush(blackColor);
  140. REAL width = 10.0f;
  141. Pen pen(&brush, width);
  142. pen.SetDashCap(DashCapRound);
  143. pen.SetDashStyle(DashStyleDashDot);
  144. float carray[8] = { 0.0f, 0.15f, 0.25f, 0.5f, 0.5f, 0.75f, 0.85f, 1.0f };
  145. // pen.SetCompoundArray(carray, 8);
  146. g->DrawPath(&pen, path);
  147. delete path;
  148. }