Click here to Skip to main content
15,886,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used angle arc to divide circle into 8 segments, when i extend an angle of one angle arc then the other dissappears , it does not overwrites what to do?

What I have tried:

i used the below code
MoveToEx(hMemDC,50,50 , (LPPOINT) NULL);
AngleArc(hMemDC, 50 , 50 , 47, 0, 45);
SetArcDirection(m_hMemDC, AD_CLOCKWISE);
LineTo(hMemDC,50,50);
EndPath(hMemDC);
StrokeAndFillPath(hMemDC);
then

MoveToEx(hMemDC,50,50 , (LPPOINT) NULL);
AngleArc(hMemDC, 50 , 50 , 47, 45, 45);
SetArcDirection(m_hMemDC, AD_CLOCKWISE);
LineTo(hMemDC,50,50);
EndPath(hMemDC);
StrokeAndFillPath(hMemDC);

and so on..

now if i want to increase the angle of 2nd segment to 55 degrees then the 3rd segment dissappears. how to solve it ?
Posted
Updated 12-Apr-16 6:16am
Comments
Jochen Arndt 30-Mar-16 4:30am    
This is difficult to imagine without seeing what is drawn.
It is also suspicious that you told us that the 3rd segment disappears when it is drawn after the 2nd one. How can this be?

But there is one thing that you should check:
There is no call to BeginPath().
Member 10536430 30-Mar-16 5:30am    
sorry i missed it, actualy i have beginpath in my code . At first i have drawn all the segments , then in each spin control click i need to increment the angle of a particular segment , while incrementing that particular segment the next segment after that respective segment will be dissappearing. actually while incrementing i need that segment to come over the next one.

1 solution

You must redraw all in steps. Imagine it as cartoon and manage every picture. You need some timer which increases and calls your paint routine.

Meta code for it:

C++
//preparing code
//get DC and so on...

//get step
int step = ticker % STEPCOUNT;

switch( step )
{
 case 0: 
//draw step 0
break;

case 1://draw step 0
break;

// and so on ...
}

//cleanup ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900