C
Carsten Marx
Hello,
i need a solution for painting, scaling and animating many objects paralell.
I've tried a few things, especially this:
public void offScreenPainting()
{
Graphics gxOn = this.CreateGraphics();
gxOn.FillRectangle(new SolidBrush(Color.White),r1);
gxOn.FillRectangle(new SolidBrush(Color.White),r2);
gxOn.FillRectangle(new SolidBrush(Color.White),r3);
gxOn.FillRectangle(new SolidBrush(Color.White),r4);
if( i < 200 && bu)
{
i ++;
r1.X +=1; r1.Y += 1;
r2.X += 1;
r3.Y += 1;
r4.X -=1; r4.Y -= 1;
}
else
{
i --;
bu = false;
r1.X -=1; r1.Y -= 1;
r2.X -= 1;
r3.Y -= 1;
r4.X +=1; r4.Y += 1;
if( i < 1) bu = true;
}
gxOn.DrawString("flying Text",f,b,r1);
gxOn.DrawString("flying Text",f,b,r2);
gxOn.DrawString("flying Text",f,b,r3);
gxOn.DrawString("flying Text",f,b,r4);
gxOn.Dispose();
}
My problem is, that if i have a timer for animating things (like a
flying and scaling text on the screen) the screen is flashing....
is there a more efficient way to do this withuot flickering...
And what about the AnimateCtl in OpenNETCF - Library? Could this be
useful for me?
Regards
Carsten
i need a solution for painting, scaling and animating many objects paralell.
I've tried a few things, especially this:
public void offScreenPainting()
{
Graphics gxOn = this.CreateGraphics();
gxOn.FillRectangle(new SolidBrush(Color.White),r1);
gxOn.FillRectangle(new SolidBrush(Color.White),r2);
gxOn.FillRectangle(new SolidBrush(Color.White),r3);
gxOn.FillRectangle(new SolidBrush(Color.White),r4);
if( i < 200 && bu)
{
i ++;
r1.X +=1; r1.Y += 1;
r2.X += 1;
r3.Y += 1;
r4.X -=1; r4.Y -= 1;
}
else
{
i --;
bu = false;
r1.X -=1; r1.Y -= 1;
r2.X -= 1;
r3.Y -= 1;
r4.X +=1; r4.Y += 1;
if( i < 1) bu = true;
}
gxOn.DrawString("flying Text",f,b,r1);
gxOn.DrawString("flying Text",f,b,r2);
gxOn.DrawString("flying Text",f,b,r3);
gxOn.DrawString("flying Text",f,b,r4);
gxOn.Dispose();
}
My problem is, that if i have a timer for animating things (like a
flying and scaling text on the screen) the screen is flashing....
is there a more efficient way to do this withuot flickering...
And what about the AnimateCtl in OpenNETCF - Library? Could this be
useful for me?
Regards
Carsten