Platform: VS2005/WinXP/.NET 2.0
I am trying to make one sentence of text scroll from right to left over the form (that works well enough, although not perfect).
Problem is, when I try to add shadow to that text, shadow (drawn with DrawString in OnPaint event) is a bit wider, and it accumulates over time.
Left edge of a shadow is not where it should be - it is more to the left then it should be.
(image can be seen here: "http://i274.photobucket.com/albums/jj262/dzenanz/ScreenShot1.png")
Also, as the whole thing moves to the left, it leaves a nasty trail behind (on the right).
(image can be seen here: "http://i274.photobucket.com/albums/jj262/dzenanz/ScreenShot2.png")
Code Snippet
private void panel1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawString(label1.Text, label1.Font,
new System.Drawing.SolidBrush(Color.FromArgb(64, label1.ForeColor)),
label1.Left + 1, label1.Top + 1);//try changing these to 5 or 10
}
private void timer1_Tick(object sender, EventArgs e)
{
if (label1.Left + label1.Width < 0)
label1.Left = panel1.Width;
else
label1.Left -= 1;
}
As you probably guess, this is just simplified problem in a larger project... Any ideas how to solve abovementioned problems?