1.7 // drawing the caption: |
2.7 SetBkMode(hDC, TRANSPARENT); |
3.7 fontCaption = CreateFontIndirect(&lf2); |
4.7 SelectObject(hDC, fontCaption); |
5.7 TextOut(hDC, 130, 20, caption, strlen(caption)); |
6.7 // drawing the plot rectangle: |
7.7 SelectObject(hDC, hWhitePen); |
8.7 Rectangle(hDC, zLeft, yTop-4, zLeft+width, yTop+height+4); |
9.7 // drawing the Z-axis with an arrow head: |
10.7 SelectObject(hDC, hBlackPen); |
11.7 MoveToEx(hDC, zLeft, yTop + height2, NULL); |
12.7 LineTo(hDC, zLeft + width + 15, yTop + height2); |
13.7 LineTo(hDC, zLeft + width + 10, yTop + height2 -2); |
14.7 MoveToEx(hDC, zLeft + width + 15, yTop + height2, NULL); |
15.7 LineTo(hDC, zLeft + width + 10, yTop + height2 +2); |
16.7 // drawing the horizontal grey gridlines: |
17.7 SelectObject(hDC, hGreyPen); |
18.7 MoveToEx(hDC, zLeft, yTop + height2*2/3, NULL); |
19.7 LineTo(hDC, zLeft + width, yTop + height2*2/3); |
20.7 MoveToEx(hDC, zLeft, yTop + height2/3, NULL); |
21.7 LineTo(hDC, zLeft + width, yTop + height2/3); |
22.7 MoveToEx(hDC, zLeft, yTop + height2*4/3, NULL); |
23.7 LineTo(hDC, zLeft + width, yTop + height2*4/3); |
24.7 MoveToEx(hDC, zLeft, yTop + height2*5/3, NULL); |
25.7 LineTo(hDC, zLeft + width, yTop + height2*5/3); |
26.7 // drawing the horizontal black axis with tick marks: |
27.7 SelectObject(hDC, hBlackPen); |
28.7 MoveToEx(hDC, zLeft, yTop + height + 25, NULL); |
29.7 LineTo(hDC, zLeft + width, yTop + height + 25); |
30.7 // drawing the y-axis with an arrow head: |
31.7 MoveToEx(hDC, zLeft, yTop + height + 25, NULL); |
32.7 LineTo(hDC, zLeft, yTop - 15); |
33.7 LineTo(hDC, zLeft - 2, yTop - 10); |
34.7 MoveToEx(hDC, zLeft, yTop - 15, NULL); |
35.7 LineTo(hDC, zLeft + 2, yTop - 10); |
36.7 // drawing the vertical grey gridlines: |
37.7 SelectObject(hDC, hGreyPen); |
38.7 for(int i = 1; i <= 11; ++i) |
39.7 MoveToEx(hDC, zLeft+(int)(0.01*mz*i), yTop+height, NULL); |
40.7 LineTo(hDC, zLeft + (int)(0.01*mz*i), yTop-1); |
41.7 |
42.7 // drawing the electrodes: |
43.7 SelectObject(hDC, hBlackBrush); |
44.7 Rectangle(hDC,zLeft,yTop-4,zLeft+(int)(12.7*kzy*mz),yTop); |
45.7 Rectangle(hDC, zLeft + (int)((28.0-12.7)*kzy*mz), yTop-4, |
46.7 zLeft + width, yTop); |
47.7 Rectangle(hDC, zLeft, yTop+height, zLeft + (int)(12.7*kzy*mz), |
48.7 yTop + height + 4); |
49.7 Rectangle(hDC, zLeft+ (int)((28.0-12.7)*kzy*mz), yTop+height, |
50.7 zLeft + width, yTop + height + 4); |
51.7 // drawing the equipotential lines and labels of potentials: |
52.7 SelectObject(hDC, hPinkPen); |
53.7 DrawEquipotentialLines(hDC, fontPotential, lf, hBlackPen, |
54.7 Particle::pF); |