Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
Point p61 = Point(x3,y3);
Point p64 = Point(x4,y4);
Point p65 = Point(x5,y5);

cli::array<point>^ curvePoint6 = { p61,p64,p65 };
g->DrawCurve(blackpen, curvePoint6);

this is code for curve drawing
and I want this curve to move in any direction
C++
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
//here i am trying to move it from left to right
x3++;
x4++;
x5++;
Refresh();
//when x4 reach 100 place 

while(x4 = 100 )
{
y3++;
y4++;
y5++;
Refresh();
}
}
i taught this method works but the whole curve is not moving instead it increments and the curve is becoming bigger
please let me know if there is any other method to do
thank you

What I have tried:

i tried incrementing in timer tick function
Posted
Updated 20-Nov-17 5:55am
v2
Comments
jeron1 20-Nov-17 10:35am    
While I've not used CLI and haven't looked at you logic, I do know that this statement
while(x4 = 100 ) looks suspicious, and probably doesn't do what you think it does, it assigns the value 100 to x4, it does not test to see if x4 is equal to 100.
try, while (x4 == 100) instead.
Member 13475664 21-Nov-17 2:43am    
i tried its not working
jeron1 21-Nov-17 10:06am    
Have you stepped through the code using a debugger?

1 solution

As jeron has written the while is buggy and not needed.

Why arent you using the handy function Graphics.FillEllipse?

If you want manually draw a circle you need some knowledge about trigonomy and some C++ code.
 
Share this answer
 
Comments
Member 13475664 21-Nov-17 2:48am    
i dont want a circle i want a line or curve to move on the form

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