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();
                }
            }
    

     

  • 相关阅读:
    TabControl
    Loading
    Dialog
    Combobox
    Markdown编辑器Editor.md使用方式
    XSS攻击
    跨域解决方案及实现
    angular4 自定义表单组件
    angular4 Form表单相关
    js 详解setTimeout定时器
  • 原文地址:https://www.cnblogs.com/feiyucha/p/10266156.html
Copyright © 2011-2022 走看看