最近在做个项目,想做个窗体打开时的特殊效果,比如像幻灯片放映的那些效果!慢慢由透明到不透明的我会了!我要其它的效果!

解决方案 »

  1.   

    可以
    看看WinForm Splash
    [System.Runtime.InteropServices.DllImport("user32")]
            private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
            private const int AW_HOR_POSITIVE = 0x0001;//从左向右显示
            private const int AW_BLEND = 0x80000;//透明渐变显示效果
     
     
      

  2.   

    错开的百叶窗 #region void frmLogo_Shown(object sender, EventArgs e) // 显示
            /// <summary>
            /// 显示
            /// </summary>
            /// <param name="sender">窗口本身</param>
            /// <param name="e">窗口参数</param>
            void frmLogo_Shown(object sender, EventArgs e)
            {
                Thread.Sleep(50);
                Bitmap MyBitmap = (Bitmap)this.PbLogo.Image.Clone();
                int dh = MyBitmap.Height / 20;
                int dw = MyBitmap.Width;
                Graphics g = PbBYLogo.CreateGraphics();
                Point[] MyPoint = new Point[20];
                for (int y = 0; y < 20; y++)
                {
                    MyPoint[y].X = 0;
                    MyPoint[y].Y = y * dh;
                }
                Bitmap bitmap = new Bitmap(MyBitmap.Width, MyBitmap.Height);
                for (int i = 0; i < dh; i++)
                {
                    for (int j = 0; j < 20; j++)
                    {
                        for (int k = 0; k < dw; k++)
                        {
                            bitmap.SetPixel(MyPoint[j].X + k, MyPoint[j].Y + i, MyBitmap.GetPixel(MyPoint[j].X + k, MyPoint[j].Y + i));
                        }
                    }
                    PbBYLogo.Image = bitmap;
                    PbBYLogo.Visible = true;
                    PbBYLogo.Update();
                    Thread.Sleep(50);
                }
                Close();
            }
            #endregion
      

  3.   

    上面的朋友能不能解释下里面的一些命名啊?
    (Thread.Sleep(50); Bitmap MyBitmap = (Bitmap)
      this.PbLogo.Image.Clone();  
      Graphics g = PbBYLogo.CreateGraphics(); 
      PbBYLogo.Image = bitmap;
      PbBYLogo.Visible = true;
      PbBYLogo.Update();
      Thread.Sleep(50);)
      

  4.   

    api 直接调用就是了[System.Runtime.InteropServices.DllImport("user32")] 
            private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); 
            private const int AW_HOR_POSITIVE = 0x0001;//从左向右显示 
            private const int AW_BLEND = 0x80000;//透明渐变显示效果 
    AnimateWindow(this.Handle,1000,AW_HOR_POSITIVE);