Problem with DC_BURSH and SetDCBrushColor?
Aug 19, 2014 at 9:35pm UTC
So I'm trying to create a Pie Chart in my application. When I use GetStockObject(GRAY_BRUSH) like so:
1 2 3 4 5 6 7 8 9 10 11 12 13
case IDB_BUTTON:
{
HDC hdc = GetDC(hwndDlg);
BeginPath(hdc);
SelectObject(hdc, GetStockObject(GRAY_BRUSH));
MoveToEx(hdc, nX, nY, (LPPOINT) NULL);
AngleArc(hdc, nX, nY, dwRadius, xStartAngle, xSweepAngle);
LineTo(hdc, nX, nY);
EndPath(hdc);
StrokeAndFillPath(hdc);
ReleaseDC(hwndDlg, hdc);
}
break ;
... it all works fine. But I want my pie slices to be colored, so I try doing this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
case IDB_BUTTON:
{
HDC hdc = GetDC(hwndDlg);
SetDCBrushColor(hdc,RGB(253,157,1));
BeginPath(hdc);
SelectObject(hdc, GetStockObject(DC_BRUSH));
MoveToEx(hdc, nX, nY, (LPPOINT) NULL);
AngleArc(hdc, nX, nY, dwRadius, xStartAngle, xSweepAngle);
LineTo(hdc, nX, nY);
EndPath(hdc);
StrokeAndFillPath(hdc);
ReleaseDC(hwndDlg, hdc);
}
break ;
But I get that SetDCBrushColor and DC_BURSH were not declared in this scope. I already tried linking gdi32.lib and no results. I'm using Code::Blocks 10.05, (May 27 2010 version).
Any help?
Thanks in advance :)
Last edited on Aug 24, 2014 at 2:58pm UTC
Aug 24, 2014 at 2:58pm UTC
Bump?.. any help?.. I'm completely stuck on this :(
EDIT: tried updating my codeblocks to the latest version version but that didn't help
Last edited on Aug 24, 2014 at 3:15pm UTC
Topic archived. No new replies allowed.