如题,求pictureBox放大缩小功能,最好能找到示例代码,谢了

解决方案 »

  1.   

    http://blog.csdn.net/Rommen/archive/2009/10/21/4706759.aspx 希望有所帮助
      

  2.   

    http://download.csdn.net/source/523842看看这个对你有用没
      

  3.   

    /// <summary>
            /// 放大图形
            /// </summary>
            /// <param name="p_Bitmap">图形</param>
            /// <param name="p_Width">放大后的宽</param>
            /// <param name="p_Height">放大后高</param>
            /// <param name="p_ZoomType">放大类型 true为插值</param>
            /// <returns>放大后的图形</returns>
            public static Image BitmapToBlowUp(Image p_Bitmap, int p_Width, int p_Height, bool p_ZoomType)
            {
                Bitmap _ZoomBitmap = new Bitmap(p_Width, p_Height);            Graphics _Graphics = Graphics.FromImage(_ZoomBitmap);            if (!p_ZoomType)
                {
                    _Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
                    _Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
                }            _Graphics.DrawImage(p_Bitmap, 0, 0, _ZoomBitmap.Width, _ZoomBitmap.Height);
                _Graphics.Dispose();
                return _ZoomBitmap;
            }
      

  4.   

    解决了 
    很简单
           //对图片进行放大缩小操作       
            private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
            {
                //string  width = pictureBox1.Width.ToString();
                if (e.Button == MouseButtons.Left)
                {
                    if (pictureBox1.Width < 1360)
                    {
                        pictureBox1.Width = Convert.ToInt32(pictureBox1.Width * 1.2);
                        pictureBox1.Height = Convert.ToInt32(pictureBox1.Height * 1.2);
                    }
                }
                if (e.Button == MouseButtons.Right)
                {
                    if (pictureBox1.Width > 635)
                    {
                        pictureBox1.Width = Convert.ToInt32(pictureBox1.Width / 1.2);
                        pictureBox1.Height = Convert.ToInt32(pictureBox1.Height / 1.2);
                    }
                }
            }