Масштабирование pictureBox на колесико мыши

Всем привет, у меня такой вопрос: Есть код, метод Draw() отрисовывает множество Мандельброта при нажатии на button1. Мне нужно масштабировать то что я отрисовал на колесико мыши ( то есть увеличивать/уменьшать при скроллинге колесика ).

В интернете находил большое количество кода но не понимаю как впихнуть все это в свою программу. Может кто нибудь сможет помочь, или кинуть ссылки на подробное объяснение как это сделать?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp11
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }


        public void Draw()
        {
            Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            for (int x = 0; x < pictureBox1.Width; x++)
            {
                for (int y = 0; y < pictureBox1.Height; y++)
                {
                    double a = (double)(x - (pictureBox1.Width / 2)) / (double)(pictureBox1.Width / 4);
                    double b = (double)(y - (pictureBox1.Height / 2)) / (double)(pictureBox1.Height / 4);
                    Complex c = new Complex(a, b);
                    Complex z = new Complex(0, 0);
                    int it = 0;
                    do
                    {
                        it++;
                        z.Cobe();
                        z.Add(c);

                        if (z.Magnitude() > 2.0)
                            break;
                    }
                    while (it < 100);

                    bmp.SetPixel(x, y, it < 100 ? Color.FromArgb(it % 2 * 128, it % 2 * 33, it % 2 * 66) : Color.FromArgb(255, 255, 255));
                }
                pictureBox1.Image = bmp;              
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Draw();
        }
    }
}

Ответы (0 шт):