系统是一个监控系统,winform的,有三个gif动画(红、黄、绿)来表示设备的状态,窗体中有多个button,每个button表示一个设备,button的image属性设置了这三个gif,gif是闪烁的。现在的问题是这三个gif在有的机器上不闪烁或者闪烁很迟钝,而在有的机器上闪烁正常,这是什么原因阿?

解决方案 »

  1.   

    不知道没做winform的帮你顶了、多测试下。看看什么引起的?
      

  2.   

    是GIF里的画面帧延迟设置的问题把.可能和机器不同显示不同
      

  3.   

    好像有个cache还是buffer什么的,忘了
      

  4.   

    可能有多种原因吧。Try://Doublebuffer to eliminate glint
    SetStyle(ControlStyles.SupportsTransparentBackColor, true);
    SetStyle(ControlStyles.AllPaintingInWmPaint, true);
    SetStyle(ControlStyles.UserPaint, true);
    SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer, true);
      

  5.   

    SetStyle(ControlStyles.SupportsTransparentBackColor, true);
    SetStyle(ControlStyles.AllPaintingInWmPaint, true);
    SetStyle(ControlStyles.UserPaint, true);
    SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer, true);
    -------------
    没管事阿 :(
      

  6.   

    csShooter 说的正确 
       
       设置DoubleBuffered为true
      

  7.   

    找出原因了,原来是gif没有做好,从网上找了几个gif后解决了此问题。