i wrote a code
it's very well but how can i speed it up that it will not look like jumping and look nice so i want to know what to speed up the interval of the timer or to decrease the X point in getpoint or something else
please if you can write a code to do
thank
Code:
public partial class frmFlow : Form
{
string FineString = " ";
PointF thispoint;
Font thisFont = new Font("Times New Roman", 100);
SolidBrush thisbrush = new SolidBrush(Color.Red);
public frmFlow()
{
InitializeComponent();
}
private void frmFlow_Load(object sender, EventArgs e)
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
timer1.Start();
}
SizeF size = new SizeF();
RectangleF rc = new RectangleF();
private void timer1_Tick(object sender, EventArgs e)
{
FineString = "(-: Smile :-)";
timer1.Interval = 33; //(int)nudSpeed.Value; ;
Invalidate();
}
protected PointF getPoint()
{
thispoint.X -= 5;//(int)nudDistance.Value;
if (thispoint.X <= 0 - size.Width)
{
thispoint.X = this.Width;
}
thispoint.Y = 180;
return thispoint;
}
private void frmFlow_Paint(object sender, PaintEventArgs e)
{
size = e.Graphics.MeasureString(FineString, thisFont);
e.Graphics.DrawString(FineString, thisFont, thisbrush, getPoint());
}
}
it's very well but how can i speed it up that it will not look like jumping and look nice so i want to know what to speed up the interval of the timer or to decrease the X point in getpoint or something else
please if you can write a code to do
thank
Comment