好吧,我的是在lblText_paint 方法中重绘的,用   
    e.Graphics.DrawString(showText.Caption, getFont(), SbFont,rectFont,GetFormat());//将对应的文字写到矩形上    

解决方案 »

  1.   

     void lblText_Paint(object sender, PaintEventArgs e)
            {
                Rectangle rectFont = new Rectangle();
                SolidBrush SbFont = null;
                e.Graphics.PageUnit = GraphicsUnit.Pixel;
                e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
                e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
                SbFont = new SolidBrush(ColorTranslator.FromWin32(showText.FontColor));
                Point pt = new Point(0, 0);
                switch (showText.Direction)
                {//滚动方向0:向右滚动,1:向左滚动,2:向下滚动,3:向上滚动。
                    case 0:
                        if (x >= this.Width)
                            x = -((int)oneSize.Width + 1);
                        else
                            x += showText.Speed;
                        pt.X = x;
                        break;
                    case 1:
                        if (x <= -((int)oneSize.Width + 1))
                            x = this.Width;
                        else
                            x -= showText.Speed;
                        pt.X = x;
                        break;
                    case 2:
                        if (y >= this.Height)
                            y = -((int)oneSize.Height + 1);
                        else
                            y += showText.Speed;
                        pt.Y = y;
                        break;
                    case 3:
                        if (y <= -((int)oneSize.Height + 1))
                            y = this.Height;
                        else
                            y -= showText.Speed;
                        pt.Y = y;
                        break;                default:                    break;
                }
                e.Graphics.TranslateTransform(pt.X, pt.Y);
                if (showText.TextDirection == 1)
                {
                    rectFont = new Rectangle(0, 0, (int)oneSize.Width + 1, (int)oneSize.Height);
                }
                else
                {
                    rectFont = new Rectangle(0, lblText.Height / 9, (int)oneSize.Width + 1, (int)oneSize.Height);
                }
               e.Graphics.DrawString(showText.Caption, getFont(), SbFont,rectFont,GetFormat());//将对应的文字写到矩形上
                e.Graphics.Flush();
            }
    重绘的代码,现在就是有卡顿的感觉,滚动的不流畅,我用timer进行刷新。
      

  2.   

    不行,cpu占用率太大,别的窗口移动的时间就会很卡,已经试过了!
      

  3.   

    做成图片,然后移动图片位置。这样可以省去每次重绘占用CPU。
      

  4.   

    //把timer换成Thread,可以提高点帧数,看看满足需求不 Thread th;
    //Init
    th = new Thread(new ThreadStart(XXXX));
    th.Start();//XXXX
    void XXXX()
    {
        while (!lblText.Created);
        while (true)
        {
            if (!lblText.Created) break;
            lblText.Invalidate();
            Thread.Sleep(10);
         }
    }//Paint上面代码SbFont后面要释放 
    SbFont.Dispose();
      

  5.   

    我只能说,GDI+不适合干这个,GDI+是为了图形绘制而不是为了显示。换WPF把,有显卡加速的帮助,什么动画都好做的。
      

  6.   

    gdi+太慢了,换wpf
      

  7.   

    我觉得这事和gdi+没关系,而是winform的print方式和消息循环不适合做动画,并不是GDI+算的不够快。wpf是调用directX,也就是显卡做显示。填充显存显卡就输出了,输出的帧数只和计算速度发生关系。
      

  8.   

    如果是个小的独立的项目,建议改用WPF,在动画处理上很有优势。
      

  9.   

    你如果要用form写的话就生成图片,然后用两个pictureBox显示,不断地改变location,移出范围就交替换位。不断循环。
      

  10.   

    是在项目里的一个模块,不能换wpf,要不也不会这么纠结的
      

  11.   

    找个载体,移动location试试。
      

  12.   

    大屏幕,,为什么要用cs做 .?  你看人家LED的东西 很多都是html滚动..那个html代码qu什么什么的 就可以 还研发CS,浪费时间.
      

  13.   

    用线程调用,进行重绘,还能稍微好点,还是需要再琢磨下。cpu占用还是有些高。