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.

65 lines
1.9 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: CPrimitives.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 "CPrimitives.h"
  14. CPrimitives::CPrimitives(BOOL bRegression)
  15. {
  16. strcpy(m_szName,"Primitives");
  17. m_bRegression=bRegression;
  18. }
  19. CPrimitives::~CPrimitives()
  20. {
  21. }
  22. void CPrimitives::Draw(Graphics *g)
  23. {
  24. Rect rect;
  25. rect.X = (int)(100.0f/400.0f*TESTAREAWIDTH);
  26. rect.Y = (int)(160.0f/400.0f*TESTAREAHEIGHT);
  27. rect.Width = (int)(230.0f/400.0f*TESTAREAWIDTH);
  28. rect.Height = (int)(180.0f/400.0f*TESTAREAHEIGHT);
  29. Color color(128, 128, 255, 0);
  30. SolidBrush brush(color);
  31. REAL width = 1;
  32. Color blackColor(0, 0, 0);
  33. SolidBrush blackBrush(blackColor);
  34. Pen pen(&blackBrush, width);
  35. // g->FillEllipse(&brush, rect);
  36. // g->DrawEllipse(&pen, rect);
  37. REAL startAngle = 0;
  38. REAL sweepAngle = 240;
  39. g->FillPie(&brush, rect, startAngle, sweepAngle);
  40. g->DrawPie(&pen, rect, startAngle, sweepAngle);
  41. Point pts[10];
  42. INT count = 4;
  43. pts[0].X = (int)(100.0f/400.0f*TESTAREAWIDTH);
  44. pts[0].Y = (int)(60.0f/400.0f*TESTAREAHEIGHT);
  45. pts[1].X = (int)(50.0f/400.0f*TESTAREAWIDTH);
  46. pts[1].Y = (int)(130.0f/400.0f*TESTAREAHEIGHT);
  47. pts[2].X = (int)(200.0f/400.0f*TESTAREAWIDTH);
  48. pts[2].Y = (int)(260.0f/400.0f*TESTAREAHEIGHT);
  49. pts[3].X = (int)(300.0f/400.0f*TESTAREAWIDTH);
  50. pts[3].Y = (int)(80.0f/400.0f*TESTAREAHEIGHT);
  51. g->FillClosedCurve(&brush, pts, count);
  52. g->DrawClosedCurve(&pen, pts, count);
  53. }