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.

64 lines
2.1 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: CPolygons.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 "CPolygons.h"
  14. CPolygons::CPolygons(BOOL bRegression)
  15. {
  16. strcpy(m_szName,"Polygons");
  17. m_bRegression=bRegression;
  18. }
  19. CPolygons::~CPolygons()
  20. {
  21. }
  22. void CPolygons::Draw(Graphics *g)
  23. {
  24. REAL width = 4; // Pen width
  25. Color redColor(255, 0, 0);
  26. SolidBrush redBrush(redColor);
  27. g->FillRectangle(&redBrush, (int)(20.0f/150.0f*TESTAREAWIDTH), (int)(20.0f/150.0f*TESTAREAHEIGHT), (int)(50.0f/150.0f*TESTAREAWIDTH), (int)(50.0f/150.0f*TESTAREAHEIGHT));
  28. Color alphaColor(128, 0, 255, 0);
  29. SolidBrush alphaBrush(alphaColor);
  30. g->FillRectangle(&alphaBrush, (int)(10.0f/150.0f*TESTAREAWIDTH), (int)(10.0f/150.0f*TESTAREAHEIGHT), (int)(40.0f/150.0f*TESTAREAWIDTH), (int)(40.0f/150.0f*TESTAREAHEIGHT));
  31. Point points[4];
  32. points[0].X = (int)(50.0f/150.0f*TESTAREAWIDTH);
  33. points[0].Y = (int)(50.0f/150.0f*TESTAREAHEIGHT);
  34. points[1].X = (int)(100.0f/150.0f*TESTAREAWIDTH);
  35. points[1].Y = (int)(50.0f/150.0f*TESTAREAHEIGHT);
  36. points[2].X = (int)(120.0f/150.0f*TESTAREAWIDTH);
  37. points[2].Y = (int)(120.0f/150.0f*TESTAREAHEIGHT);
  38. points[3].X = (int)(50.0f/150.0f*TESTAREAWIDTH);
  39. points[3].Y = (int)(100.0f/150.0f*TESTAREAHEIGHT);
  40. Color blueColor(128, 0, 0, 255);
  41. SolidBrush blueBrush(blueColor);
  42. g->FillPolygon(&blueBrush, points, 4);
  43. // Currently only Geometric pen works for lines. - ikkof 1/6/99.
  44. Color blackColor(0, 0, 0);
  45. SolidBrush blackBrush(blackColor);
  46. width = 16;
  47. Pen blackPen(&blackBrush, width);
  48. blackPen.SetLineJoin(LineJoinRound);
  49. // blackPen.SetLineJoin(LineJoinBevel);
  50. g->DrawPolygon(&blackPen, points, 4);
  51. // g->DrawLines(&blackPen, points, 4, FALSE);
  52. }