动态显示的代码在下边using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        private Bitmap SourceBitmap;
        private Bitmap MyBitmap;        public Form1()
        {
            InitializeComponent();
        }        private void btnQuit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }        private void btnOpen_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                SourceBitmap = new Bitmap(openFileDialog1.FileName);
                MyBitmap = new Bitmap(SourceBitmap, this.pictureBox1.Width, this.pictureBox1.Height);                this.pictureBox1.Image = MyBitmap;
                int width = this.MyBitmap.Width; //图像宽度
                int height = this.MyBitmap.Height; //图像高度
                Graphics g = this.pictureBox1.CreateGraphics();
                g.Clear(Color.Gray);
                 
                for (int i = -width / 2; i <= width / 2; i++)
                {
                    //g.Clear(Color.Gray);
                    //int j = Convert.ToInt32(i * (Convert.ToSingle(height) / Convert.ToSingle(width)));                    //Rectangle DestRect = new Rectangle(0, height / 2 - j, width, 2 * j);
                    //Rectangle SrcRect = new Rectangle(0, 0, MyBitmap.Width, MyBitmap.Height);                    //g.DrawImage(MyBitmap, DestRect, SrcRect, GraphicsUnit.Pixel);
                    //System.Threading.Thread.Sleep(10);                    //双缓存技术解决图像的闪烁问题
                    int j = Convert.ToInt32(i * (Convert.ToSingle(height) / Convert.ToSingle(width)));                    Rectangle DestRect = new Rectangle(0, height / 2 - j, width, 2 * j);
                    Rectangle SrcRect = new Rectangle(0, 0, MyBitmap.Width, MyBitmap.Height);                    Bitmap localBitmap = new Bitmap(pictureBox1.ClientRectangle.Width,
                                      pictureBox1.ClientRectangle.Height);
                    Graphics bitmapGraphics = Graphics.FromImage(localBitmap);                    bitmapGraphics.Clear(Color.Gray);
                    bitmapGraphics.DrawImage(MyBitmap, DestRect, SrcRect, GraphicsUnit.Pixel);
                    g.DrawImage(localBitmap, 0, 0);
                    System.Threading.Thread.Sleep(10);                     
                }
                g.Dispose();               
            }
        }
    }
}2个结合下怎么结合

解决方案 »

  1.   

    用JavaScript也能实现啊!
    <SCRIPT>
    <!--
    transeffect = 0;
    theeffects = new Array(24);
    theeffects[0] = "盒状收缩";
    theeffects[1] = "盒状向外";
    theeffects[2] = "圆形收缩";
    theeffects[3] = "圆形向内";
    theeffects[4] = "从下向上";
    theeffects[5] = "从上向下";
    theeffects[6] = "从左向右";
    theeffects[7] = "从右向左";
    theeffects[8] = "百页窗形向右";
    theeffects[9] = "百页窗形向下";
    theeffects[10] = "棋盘形交叉向右";
    theeffects[11] = "棋盘形交叉向下";
    theeffects[12] = "随意溶解形";
    theeffects[13] = "左右向内";
    theeffects[14] = "左右向外";
    theeffects[15] = "上下向内";
    theeffects[16] = "上下向外";
    theeffects[17] = "条纹状向左下";
    theeffects[18] = "条纹状向左上";
    theeffects[19] = "条纹状向右下";
    theeffects[20] = "条纹状向右上";
    theeffects[21] = "溶解水平状";
    theeffects[22] = "溶解上下状";
    theeffects[23] = "随着溶解";
    current_image = "image1";
    function Clicked() {
     var the_image, the_other;
     text2.style.visiblity="hidden";
     if (image1.style.visibility=="inherit") {
      the_image = image2;
      the_other = image1;
      }
     else {
      the_image = image1;
      the_other = image2;
      } 
     the_other.style.visibility="hidden";
     the_image.filters.item(0).Apply();
     the_image.filters.item(0).Transition = transeffect;
     the_image.filters.item(0).Play(2.0);
     the_image.style.visibility="inherit";
     text2.innerText=theeffects[transeffect];
     transeffect++;
     if (transeffect == 24)
      transeffect = 0;
     text2.style.visibility="visible";
    }
    //-->
    </SCRIPT>
    <DIV id=image>
    <DIV id=text1></DIV><IMG id=image1 
    src="images/logo.gif" 
    style="FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden"> <IMG id=image2 src="Pioneer/Pioneer/Image/1.jpg" 
    style="FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden"> </DIV>
    <DIV id=text2></DIV><body bgcolor="#fef4d9" onclick=Clicked()>