|I am trying to draw a shape or font on dialog and then fill the outline. I have 2 buttons on this 2 buttons I have the following code
MessageBox(hDlg, L"Start Drawing!!", L"ButtonPressed", MB_OK | MB_ICONEXCLAMATION);
hDC = GetDC(hDlg);
brush = CreateSolidBrush(RGB(128, 128, 128));
hpen = CreatePen(PS_SOLID, 1, RGB(128, 0, 128));
MessageBox(hDlg, L"End Drawing!!", L"ButtonPressed", MB_OK | MB_ICONEXCLAMATION);
Then in the drawing part I have the following.
if (IsDlgButtonChecked(hDlg, IDC_RADIO1) == BST_CHECKED )
EndX = LOWORD(lParam);
EndY = HIWORD(lParam);
MoveToEx(hDC, StartX, StartY, NULL);
LineTo(hDC, EndX, EndY);
IsDrawing = FALSE;
When I remove the BeginPath() and EndPath() functions my lines are being drawn. But when I insert this BeginPath() and EndPath() and StrokeAndFillPath(hDC); the nothing is being drawn.
Why it is not doing as per the expectations. I want to draw a shape for example A with a outline. And i want it to be closed when drawing is ended and filled the hollow portion.
What am I doing wrong in this ? Please help. I am not implementing it in WM_PAINT but drawing is done in WM_LBUTTONUP. Please help. Thanks a lot in advance