zoukankan      html  css  js  c++  java
  • 局部图像放大

    实现效果:

      

    知识运用:

      DrawImage方法

      public void DrawImage (Image image, Point point)    //指定位置绘制原始大小图像

      publIc void DrawImage (Image image,Rectangel rect)    //指定位置绘制指定大小的Image图像

      publicvoid DrawImage (Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)  //指定大小绘制指定部分的图像

      # image      要绘制的Image图像

      # destImage    有三个Point结构组成的数组 这三个结构定义一个平行四边形

      # srcRect      Rectangle结构 指定image中要绘制的部分

      # srcUnit          GraphicsUnit枚举成员  指定srcRect参数所用的度量单位

    实现代码:

            private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
            {
                try
                {
                    Cursor.Current = myCursor;                                          //定义鼠标  
                    Rectangle rectangle = new Rectangle(e.X-10,e.Y-10,20,20);           //要放大的区域
                    Rectangle destRectangle = new Rectangle(e.X-40,e.Y-40,80,80);
                    Graphics graphics = pictureBox1.CreateGraphics();                   //创建pictureBox1控件的Graphics对象
                    graphics.DrawImage(image,destRectangle,rectangle,GraphicsUnit.Pixel);
                }
                catch{}
            }
    

      

  • 相关阅读:
    Tomcat
    二叉树
    CDOJ 1962 天才钱vs学霸周2【最大流】
    次小生成树(POJ1679/CDOJ1959)
    CDOJ1927 爱吃瓜的伊卡洛斯(2) 【并查集】启发式合并+set
    HDU 1074 Doing Homework(DP状态压缩)
    uva 11367 (Dijkstra+DP)
    线段树模板
    openpose pytorch代码分析
    opencv图片坐标和数组下标
  • 原文地址:https://www.cnblogs.com/feiyucha/p/10261259.html
Copyright © 2011-2022 走看看