Hellow
i am trying to anamate text its size is 200 ,it works but i notice a flicker in the letters.I tryed by drawstring using 2 diffrent colors
(white to erase string then Red to draw the string ),i also did the similar thing using a image jpg but no diffrence
any suggestion or if you know any other method
Timer tm = new Timer();
Image imageFile;
PointF po;
Graphics g;
SolidBrush brushRed = new System.Drawing.SolidBrush(Color.FromArgb(255, 0, 0));
SolidBrush brushWhite = new System.Drawing.SolidBrush(Color.FromArgb(255, 255, 255));
Font font1 = new System.Drawing.Font("Tahoma", 200F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
float xx , yy = 10;
Graphics g;
Rectangle rect;
public Form1()
{
InitializeComponent();
}
void f1(Object x,EventArgs e)
{
g.DrawString("Jan-2-2015", font1, brushWhite, xx, yy);
xx = xx + 5;
g.DrawString("Jan-2-2015", font1, brushRed, xx, yy);
if ((int)xx >= panel1.Width) xx = -panel1.Width;
}
private void Timer1_Click(object sender, EventArgs e)
{
tm.Interval = 20;
tm.Enabled = true;
tm.Tick += new EventHandler(f1);
tm.Start();
}
private void Stop_Timer1(object sender, EventArgs e)
{
tm.Stop();
g.Dispose();
}
private void FormLoad(object sender, EventArgs e)
{
g=panel1.CreateGraphics();
xx = -panel1.Width;
rect = new Rectangle(1, 1, panel1.Width, panel1.Height);
}