Advertisement
Guest User

Untitled

a guest
May 6th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. PAINTSTRUCT ps;
  2. HDC hdcOkno;
  3. hdcOkno = GetDC ( hwnd );
  4. POINT stary_punkt;
  5. HPEN CzerwonePioro;
  6. HPEN BialePioro;
  7. HPEN CzarnePioro;
  8. HPEN Wykres;
  9. HPEN Wykres2;
  10. HPEN Wykres3;
  11.  
  12. RECT rect;
  13. HFONT hFont;
  14.  
  15. int x=320;
  16. int y=270;
  17.  
  18.  
  19.  
  20. switch (message) /* handle the messages */
  21. {
  22.  
  23. case WM_PAINT:
  24. {
  25.  
  26. hdcOkno = BeginPaint(hwnd, &ps);
  27. CzarnePioro = CreatePen( PS_SOLID, 3, 0x000000 );
  28. SelectObject( hdcOkno, CzarnePioro );
  29. MoveToEx( hdcOkno, 300, 30, & stary_punkt );
  30. LineTo( hdcOkno, 300,300 ); //pierwsze musi byc pixel wiecej a przynajmniej tak pisalo w tutorialu lol
  31. MoveToEx( hdcOkno, 290, 290, & stary_punkt );
  32. LineTo( hdcOkno, 560,290);
  33. CzerwonePioro = CreatePen( PS_SOLID, 3, 0xFF0000 );
  34.  
  35. hFont = CreateFont(20,0,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_OUTLINE_PRECIS,
  36. CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY, VARIABLE_PITCH,TEXT("Impact"));
  37. SelectObject(hdcOkno , hFont);
  38.  
  39. SetRect(&rect, 250,20,0,0);
  40. SetTextColor(hdcOkno, RGB(0,0,0));
  41. DrawText(hdcOkno, TEXT("2600"), -1,&rect, DT_NOCLIP);
  42.  
  43. SetRect(&rect, 250,40,0,0);
  44. DrawText(hdcOkno, TEXT("2400"), -1,&rect, DT_NOCLIP);
  45. SetRect(&rect, 250,60,0,0);
  46. DrawText(hdcOkno, TEXT("2200"), -1,&rect, DT_NOCLIP);
  47. SetRect(&rect, 250,80,0,0);
  48. DrawText(hdcOkno, TEXT("2000"), -1,&rect, DT_NOCLIP);
  49. SetRect(&rect, 250,100,0,0);
  50. DrawText(hdcOkno, TEXT("1800"), -1,&rect, DT_NOCLIP);
  51. SetRect(&rect, 250,120,0,0);
  52. DrawText(hdcOkno, TEXT("1600"), -1,&rect, DT_NOCLIP);
  53. SetRect(&rect, 250,140,0,0);
  54. DrawText(hdcOkno, TEXT("1400"), -1,&rect, DT_NOCLIP);
  55. SetRect(&rect, 250,160,0,0);
  56. DrawText(hdcOkno, TEXT("1200"), -1,&rect, DT_NOCLIP);
  57. SetRect(&rect, 250,180,0,0);
  58. DrawText(hdcOkno, TEXT("1000"), -1,&rect, DT_NOCLIP);
  59. SetRect(&rect, 250,200,0,0);
  60. DrawText(hdcOkno, TEXT("800"), -1,&rect, DT_NOCLIP);
  61. SetRect(&rect, 250,220,0,0);
  62. DrawText(hdcOkno, TEXT("600"), -1,&rect, DT_NOCLIP);
  63. SetRect(&rect, 250,240,0,0);
  64. DrawText(hdcOkno, TEXT("400"), -1,&rect, DT_NOCLIP);
  65. SetRect(&rect, 250,260,0,0);
  66. DrawText(hdcOkno, TEXT("200"), -1,&rect, DT_NOCLIP);
  67.  
  68.  
  69. SetRect(&rect, 315,300,0,0);
  70. DrawText(hdcOkno, TEXT("2"), -1,&rect, DT_NOCLIP);
  71.  
  72. SetRect(&rect, 335,300,0,0);
  73. DrawText(hdcOkno, TEXT("4"), -1,&rect, DT_NOCLIP);
  74.  
  75. SetRect(&rect, 355,300,0,0);
  76. DrawText(hdcOkno, TEXT("6"), -1,&rect, DT_NOCLIP);
  77.  
  78. SetRect(&rect, 375,300,0,0);
  79. DrawText(hdcOkno, TEXT("8"), -1,&rect, DT_NOCLIP);
  80.  
  81. SetRect(&rect, 395,300,0,0);
  82. DrawText(hdcOkno, TEXT("10"), -1,&rect, DT_NOCLIP);
  83.  
  84. SetRect(&rect, 415,300,0,0);
  85. DrawText(hdcOkno, TEXT("12"), -1,&rect, DT_NOCLIP);
  86.  
  87. SetRect(&rect, 435,300,0,0);
  88. DrawText(hdcOkno, TEXT("14"), -1,&rect, DT_NOCLIP);
  89.  
  90. SetRect(&rect, 455,300,0,0);
  91. DrawText(hdcOkno, TEXT("16"), -1,&rect, DT_NOCLIP);
  92.  
  93. SetRect(&rect, 475,300,0,0);
  94. DrawText(hdcOkno, TEXT("18"), -1,&rect, DT_NOCLIP);
  95.  
  96. SetRect(&rect, 495,300,0,0);
  97. DrawText(hdcOkno, TEXT("20"), -1,&rect, DT_NOCLIP);
  98.  
  99. SetRect(&rect, 515,300,0,0);
  100. DrawText(hdcOkno, TEXT("22"), -1,&rect, DT_NOCLIP);
  101. SetRect(&rect, 535,300,0,0);
  102. DrawText(hdcOkno, TEXT("24"), -1,&rect, DT_NOCLIP);
  103. SetRect(&rect, 555,300,0,0);
  104. DrawText(hdcOkno, TEXT("26"), -1,&rect, DT_NOCLIP);
  105.  
  106. SetRect(&rect, 30,150,0,0);
  107. DrawText(hdcOkno, TEXT("m :"), -1,&rect, DT_NOCLIP);
  108.  
  109. SetRect(&rect, 30,190,0,0);
  110. DrawText(hdcOkno, TEXT("g :"), -1,&rect, DT_NOCLIP);
  111.  
  112. SetRect(&rect, 30,230,0,0);
  113. DrawText(hdcOkno, TEXT("a :"), -1,&rect, DT_NOCLIP);
  114.  
  115. SetRect(&rect, 30,270,0,0);
  116. DrawText(hdcOkno, TEXT("F :"), -1,&rect, DT_NOCLIP);
  117.  
  118. SetRect(&rect, 220,130,0,0);
  119. DrawText(hdcOkno, TEXT("F[N] "), -1,&rect, DT_NOCLIP);
  120.  
  121. SetRect(&rect, 400,330,0,0);
  122. DrawText(hdcOkno, TEXT("a[m/s^2] "), -1,&rect, DT_NOCLIP);
  123.  
  124.  
  125. ReleaseDC( hwnd, hdcOkno );
  126. EndPaint(hwnd, &ps);
  127.  
  128. break;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement