So, hier der Code (funzt jetzt) wie gewünscht:
Code:
void CCreateGroupsView::DrawAromCycle(CDC&
DC, unsigned order, unsigned length)
{
if(!order)
return;
int oldidx =
DC.SaveDC();
CPoint org =
DC.GetCurrentPosition();
double angle = (pi * 2) / order, startangle = pi / 2;
LPPOINT points = new POINT[order], currpoint;
if(currpoint = points)
{
for(unsigned i = 0; i < order; i++)
{
currpoint->x = org.x + length * cos(i * angle + startangle);
currpoint->y = org.y + length * sin(i * angle + startangle);
currpoint++;
}
DC.Polygon(points, order);
delete points;
}
DC.RestoreDC(oldidx);
}