zoukankan      html  css  js  c++  java
  • 实现推拉效果显示图片

    实现效果:

      

    知识运用:

      Bitmap类的Clone方法复制图像

    实现代码:

            private void button1_Click(object sender, EventArgs e)
            {
                Bitmap myBitmap =(Bitmap)this.BackgroundImage.Clone();
                Graphics myGraphics = this.CreateGraphics();
                myGraphics.Clear(Color.Black);                                           //以指定颜色清除
                for (int i = 0; i < this.Height;i++ )                                    //从上到下遍历图片
                {
                    Rectangle rectangle1 = new Rectangle(0, 0, this.Width, i);           //获取图片指定行的像素
                    Rectangle rectangle2 = new Rectangle(0,this.Height-i,this.Width,i+1);//获取图片当前行的一下区域
                    Bitmap bitmap = myBitmap.Clone(rectangle2,PixelFormat.DontCare);
                    myGraphics.DrawImage(bitmap,rectangle1);                             //绘制指定大小的图片
                    this.Show();
                }
            }
    

     

  • 相关阅读:
    js 创建对象
    js的面向对象
    js的JSON
    js 标准对象
    js generator
    js 闭包
    js sort
    js filter关键字
    [转载] 自定义标签,jsp调用java类
    JSTL标签常用
  • 原文地址:https://www.cnblogs.com/feiyucha/p/10266156.html
Copyright © 2011-2022 走看看