1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
case WM_PAINT:
{
//DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
int r,g,b,x1,x2,y1,y2;
HPEN penold;
HPEN ellipsepen;
HPEN linepen;
COLORREF linecolor;
COLORREF ellipsecolor;
int i=1;
if(numlines>0){
for(int t=1;t<numlines;++t){
if(q==1)break;
//DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
r=lines.at(i);
++i;
g=lines.at(i);
++i;
b=lines.at(i);
++i;
x1=lines.at(i);
++i;
x2=lines.at(i);
++i;
y1=lines.at(i);
++i;
y2=lines.at(i);
++i;
linecolor=RGB(r,g,b);
linepen=CreatePen(PS_SOLID,7,linecolor);
penold=(HPEN)SelectObject(hdc,linepen);
MoveToEx(hdc,x1,y1,NULL);
LineTo(hdc,x2,y2);
SelectObject(hdc,penold);
DeleteObject(linepen);
} }
if(numellipses>0){
i=0;
for(int t=0;t<numellipses;++t){
r=lines.at(i);
++i;
g=lines.at(i);
++i;
b=lines.at(i);
++i;
x1=lines.at(i);
++i;
x2=lines.at(i);
++i;
y1=lines.at(i);
++i;
y2=lines.at(i);
++i;
ellipsecolor=RGB(r,g,b);
ellipsepen=CreatePen(PS_SOLID,3,ellipsecolor);
penold=(HPEN)SelectObject(hdc,ellipsepen);
Arc(hdc,x1,y1,x2,y2,0,0,0,0);
SelectObject(hdc,penold);
DeleteObject(ellipsepen);}}
EndPaint(hWnd, &ps);
break; }
|