I have a problem with the timer. I have a function in a function (draw in func)
void func(){
for(){
for() {
draw(A,B, Pen);
}
}
}
This is a drawing function.
public void draw1(Point Poc, Point Kra, Pen o) {
Graphics g = this.CreateGraphics();
g.DrawLine(o,Poc.X+4, Poc.Y+4,Kra.X+4, Kra.Y+4);
g.Dispose();
}
I call the function "func" when the button is pressed
private void button4_Click(object sender, EventArgs e){
func();
}
I want to call the evry second draw function (draw a line every second). Between the drawings, the function should continue to work and calculate = cycle, and then draw the next line for some time (interval). I tried using
timer1.Tick += new EventHandler(timer1_Tick);
etc..
private void timer1_Tick(object sender, EventArgs e)
{
...
draw(A, B, Pen)
}
etc..
but all this stops my function and draws one random line. I just need time (interval) between two drawings in the "func" function. Without a timer, it works fine, but immediately all the lines, I need a slow drawing. Greetings.