现在画出来是一条从左上角到右下角的直线,我如何能让它只画从左上角到中点?
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ static int cxClient, cyClient;
HDC hdc;
PAINTSTRUCT ps; switch (message) {
case WM_SIZE:
cxClient = LOWORD (lParam);
cyClient = HIWORD (lParam);
return 0; case WM_PAINT:
hdc = BeginPaint(hwnd,&ps); MoveToEx(hdc, 0, 0, NULL);
LineTo(hdc, cxClient, cyClient); EndPaint(hwnd, &ps);
return 0; case WM_DESTROY:
PostQuitMessage(0);
return 0; }
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ static int cxClient, cyClient;
HDC hdc;
PAINTSTRUCT ps; switch (message) {
case WM_SIZE:
cxClient = LOWORD (lParam);
cyClient = HIWORD (lParam);
return 0; case WM_PAINT:
hdc = BeginPaint(hwnd,&ps); MoveToEx(hdc, 0, 0, NULL);
LineTo(hdc, cxClient, cyClient); EndPaint(hwnd, &ps);
return 0; case WM_DESTROY:
PostQuitMessage(0);
return 0; }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货