Advertisement
AleksandarH

PS - WM_Paint

May 17th, 2022 (edited)
359
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // WHERE TO PASTE:
  2. // In WndProc, inside WM_PAINT case, between BeginPaint and EndPaint
  3.  
  4. // 3D Rectangle
  5. POINT p[4];
  6. p[0].x = 200; p[0].y = 200;
  7. p[1].x = 500; p[1].y = 200;
  8. p[2].x = 550; p[2].y = 150;
  9. p[3].x = 250; p[3].y = 150;
  10. Polygon(hdc, p, 4);
  11. p[0].x = 500; p[0].y = 400;
  12. p[1].x = 550; p[1].y = 350;
  13. p[2].x = 550; p[2].y = 150;
  14. p[3].x = 500; p[3].y = 200;
  15. Polygon(hdc, p, 4);
  16. Rectangle(hdc, 200, 200, 500, 400);
  17.  
  18. // Diamond
  19. POINT p[5];
  20. p[0].x = 500; p[0].y = 500;
  21. p[1].x = 375; p[1].y = 375;
  22. p[2].x = 450; p[2].y = 300;
  23. p[3].x = 550; p[3].y = 300;
  24. p[4].x = 625; p[4].y = 375;
  25. Polygon(hdc, p, 5);
  26. p[0].x = 450; p[0].y = 300;
  27. p[1].x = 500; p[1].y = 500;
  28. p[2].x = 550; p[2].y = 300;
  29. Polygon(hdc, p, 3);
  30. MoveToEx(hdc, 375, 375, 0);
  31. LineTo(hdc, 625, 375);
  32.  
  33. // Tall Diamond
  34. POINT p[3];
  35. p[0].x = 100; p[0].y = 200;
  36. p[1].x = 125; p[1].y = 200;
  37. p[2].x = 150; p[2].y = 100;
  38. Polygon(hdc, p, 3);
  39. p[0].x = 150; p[0].y = 100;
  40. p[1].x = 175; p[1].y = 200;
  41. p[2].x = 200; p[2].y = 200;
  42. Polygon(hdc, p, 3);
  43. Arc(hdc, 100, 150, 200, 250, 100, 200, 200, 200);
  44. Arc(hdc, 125, 175, 175, 225, 100, 200, 200, 200);
  45.  
  46. // Cone
  47. Ellipse(hdc, 100, 325, 250, 275);
  48. MoveToEx(hdc, 100, 300, 0);
  49. LineTo(hdc, 175, 150);
  50. LineTo(hdc, 250, 300);
  51. MoveToEx(hdc, 175, 150, 0);
  52. HPEN hPen = CreatePen(PS_DASH, 0, RGB(0, 0, 0));
  53. SelectObject(hdc, hPen);
  54. LineTo(hdc, 175, 300);
  55.  
  56. // Long 3D Cube
  57. Rectangle(hdc, 300, 300, 500, 500);
  58. MoveToEx(hdc, 300, 300, 0);
  59. LineTo(hdc, 700, 100);
  60. LineTo(hdc, 500, 300);
  61. MoveToEx(hdc, 700, 100, 0);
  62. LineTo(hdc, 500, 500);
Advertisement
RAW Paste Data Copied
Advertisement