需求:
winform 桌面应用程序
能不能实现在一张图片上,显示倒计时?
具体是上边是“倒计时”三个字
下边就是倒计时

解决方案 »

  1.   

    你的用GDI+画这个图了使用timer控件.绘制pictureBox就好了.
      

  2.   

    用带 “倒计时” 的picture做背景 , 放个labal 在上面 显示 倒计 怎么样?
      

  3.   


    让lable的背景色继承父容器就没底色了
      

  4.   

    加一个Timer,间隔设为多少秒就触发事件   
    图片变换  
      

  5.   

    public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();            m_Timer = new Timer();
                m_Timer.Interval = 1000;
                m_Timer.Tick += new EventHandler(m_Timer_Tick);            m_TerminalTime = new DateTime(2010, 5, 1, 8, 0, 0);
            }        protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
                m_Timer.Start();
            }        void m_Timer_Tick(object sender, EventArgs e)
            {
                m_TimeSpan = m_TerminalTime - DateTime.Now;
                pictureBox1.Invalidate();
            }        private void pictureBox1_Paint(object sender, PaintEventArgs e)
            {
                String s = m_TimeSpan.Days.ToString() + "天" 
                    + m_TimeSpan.Hours.ToString() + "小时" 
                    + m_TimeSpan.Minutes.ToString() + "分" 
                    + m_TimeSpan.Seconds.ToString() + "秒";
                e.Graphics.DrawString(s, this.Font, Brushes.Black, pictureBox1.ClientRectangle);
            }        Timer m_Timer;
            DateTime m_TerminalTime;
            TimeSpan m_TimeSpan;
        }