Browse Source

Huge performance increase

Stephen Downward 1 year ago
parent
commit
1b14dfb1e5

+ 5 - 5
MandelbrotCalc/App.config

@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8" ?>
2
<configuration>
3
    <startup> 
4
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
    </startup>
1
<?xml version="1.0" encoding="utf-8" ?>
2
<configuration>
3
    <startup> 
4
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
    </startup>
6 6
</configuration>

+ 197 - 197
MandelbrotCalc/Form1.Designer.cs

@ -1,197 +1,197 @@
1
namespace MandelBrotCalc
2
{
3
    partial class Form1
4
    {
5
        /// <summary>
6
        /// Required designer variable.
7
        /// </summary>
8
        private System.ComponentModel.IContainer components = null;
9
10
        /// <summary>
11
        /// Clean up any resources being used.
12
        /// </summary>
13
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
        protected override void Dispose(bool disposing)
15
        {
16
            if (disposing && (components != null))
17
            {
18
                components.Dispose();
19
            }
20
            base.Dispose(disposing);
21
        }
22
23
        #region Windows Form Designer generated code
24
25
        /// <summary>
26
        /// Required method for Designer support - do not modify
27
        /// the contents of this method with the code editor.
28
        /// </summary>
29
        private void InitializeComponent()
30
        {
31
            this.outputFractalImage = new System.Windows.Forms.PictureBox();
32
            this.button1 = new System.Windows.Forms.Button();
33
            this.cIndex = new System.Windows.Forms.NumericUpDown();
34
            this.label1 = new System.Windows.Forms.Label();
35
            this.iterationsNumeric = new System.Windows.Forms.NumericUpDown();
36
            this.label2 = new System.Windows.Forms.Label();
37
            this.label3 = new System.Windows.Forms.Label();
38
            this.exportBtn = new System.Windows.Forms.Button();
39
            this.boundaryCoords = new System.Windows.Forms.Label();
40
            ((System.ComponentModel.ISupportInitialize)(this.outputFractalImage)).BeginInit();
41
            ((System.ComponentModel.ISupportInitialize)(this.cIndex)).BeginInit();
42
            ((System.ComponentModel.ISupportInitialize)(this.iterationsNumeric)).BeginInit();
43
            this.SuspendLayout();
44
            // 
45
            // outputFractalImage
46
            // 
47
            this.outputFractalImage.Location = new System.Drawing.Point(12, 12);
48
            this.outputFractalImage.Name = "outputFractalImage";
49
            this.outputFractalImage.Size = new System.Drawing.Size(800, 800);
50
            this.outputFractalImage.TabIndex = 0;
51
            this.outputFractalImage.TabStop = false;
52
            this.outputFractalImage.Paint += new System.Windows.Forms.PaintEventHandler(this.outputFractalImage_Paint);
53
            this.outputFractalImage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseDown);
54
            this.outputFractalImage.MouseMove += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseMove);
55
            this.outputFractalImage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseUp);
56
            // 
57
            // button1
58
            // 
59
            this.button1.Location = new System.Drawing.Point(120, 820);
60
            this.button1.Name = "button1";
61
            this.button1.Size = new System.Drawing.Size(75, 23);
62
            this.button1.TabIndex = 1;
63
            this.button1.Text = "Reset";
64
            this.button1.UseVisualStyleBackColor = true;
65
            this.button1.Click += new System.EventHandler(this.button1_Click);
66
            // 
67
            // cIndex
68
            // 
69
            this.cIndex.Increment = new decimal(new int[] {
70
            50,
71
            0,
72
            0,
73
            0});
74
            this.cIndex.Location = new System.Drawing.Point(449, 820);
75
            this.cIndex.Maximum = new decimal(new int[] {
76
            10000,
77
            0,
78
            0,
79
            0});
80
            this.cIndex.Name = "cIndex";
81
            this.cIndex.Size = new System.Drawing.Size(78, 20);
82
            this.cIndex.TabIndex = 2;
83
            this.cIndex.Value = new decimal(new int[] {
84
            2500,
85
            0,
86
            0,
87
            0});
88
            // 
89
            // label1
90
            // 
91
            this.label1.AutoSize = true;
92
            this.label1.Location = new System.Drawing.Point(380, 823);
93
            this.label1.Name = "label1";
94
            this.label1.Size = new System.Drawing.Size(63, 13);
95
            this.label1.TabIndex = 3;
96
            this.label1.Text = "Color Index:";
97
            // 
98
            // iterationsNumeric
99
            // 
100
            this.iterationsNumeric.Increment = new decimal(new int[] {
101
            50,
102
            0,
103
            0,
104
            0});
105
            this.iterationsNumeric.Location = new System.Drawing.Point(291, 820);
106
            this.iterationsNumeric.Maximum = new decimal(new int[] {
107
            10000,
108
            0,
109
            0,
110
            0});
111
            this.iterationsNumeric.Name = "iterationsNumeric";
112
            this.iterationsNumeric.Size = new System.Drawing.Size(83, 20);
113
            this.iterationsNumeric.TabIndex = 4;
114
            this.iterationsNumeric.Value = new decimal(new int[] {
115
            1000,
116
            0,
117
            0,
118
            0});
119
            // 
120
            // label2
121
            // 
122
            this.label2.AutoSize = true;
123
            this.label2.Location = new System.Drawing.Point(201, 823);
124
            this.label2.Name = "label2";
125
            this.label2.Size = new System.Drawing.Size(84, 13);
126
            this.label2.TabIndex = 5;
127
            this.label2.Text = "Iterations Count:";
128
            // 
129
            // label3
130
            // 
131
            this.label3.AutoSize = true;
132
            this.label3.Location = new System.Drawing.Point(12, 818);
133
            this.label3.Name = "label3";
134
            this.label3.Size = new System.Drawing.Size(101, 26);
135
            this.label3.TabIndex = 6;
136
            this.label3.Text = "Software Written by\r\nStephen Downward";
137
            // 
138
            // exportBtn
139
            // 
140
            this.exportBtn.Location = new System.Drawing.Point(737, 820);
141
            this.exportBtn.Name = "exportBtn";
142
            this.exportBtn.Size = new System.Drawing.Size(75, 23);
143
            this.exportBtn.TabIndex = 7;
144
            this.exportBtn.Text = "Export";
145
            this.exportBtn.UseVisualStyleBackColor = true;
146
            this.exportBtn.Click += new System.EventHandler(this.exportBtn_Click);
147
            // 
148
            // boundaryCoords
149
            // 
150
            this.boundaryCoords.AutoSize = true;
151
            this.boundaryCoords.Location = new System.Drawing.Point(533, 818);
152
            this.boundaryCoords.Name = "boundaryCoords";
153
            this.boundaryCoords.Size = new System.Drawing.Size(50, 26);
154
            this.boundaryCoords.TabIndex = 8;
155
            this.boundaryCoords.Text = "X: -2 to 2\r\nY: -2 to 2\r\n";
156
            // 
157
            // Form1
158
            // 
159
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
160
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
161
            this.ClientSize = new System.Drawing.Size(826, 852);
162
            this.Controls.Add(this.boundaryCoords);
163
            this.Controls.Add(this.exportBtn);
164
            this.Controls.Add(this.label3);
165
            this.Controls.Add(this.label2);
166
            this.Controls.Add(this.iterationsNumeric);
167
            this.Controls.Add(this.label1);
168
            this.Controls.Add(this.cIndex);
169
            this.Controls.Add(this.button1);
170
            this.Controls.Add(this.outputFractalImage);
171
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
172
            this.MaximizeBox = false;
173
            this.Name = "Form1";
174
            this.ShowIcon = false;
175
            this.Text = "Mandlebrot calculator";
176
            ((System.ComponentModel.ISupportInitialize)(this.outputFractalImage)).EndInit();
177
            ((System.ComponentModel.ISupportInitialize)(this.cIndex)).EndInit();
178
            ((System.ComponentModel.ISupportInitialize)(this.iterationsNumeric)).EndInit();
179
            this.ResumeLayout(false);
180
            this.PerformLayout();
181
182
        }
183
184
        #endregion
185
186
        private System.Windows.Forms.PictureBox outputFractalImage;
187
        private System.Windows.Forms.Button button1;
188
        private System.Windows.Forms.NumericUpDown cIndex;
189
        private System.Windows.Forms.Label label1;
190
        private System.Windows.Forms.NumericUpDown iterationsNumeric;
191
        private System.Windows.Forms.Label label2;
192
        private System.Windows.Forms.Label label3;
193
        private System.Windows.Forms.Button exportBtn;
194
        private System.Windows.Forms.Label boundaryCoords;
195
    }
196
}
197
1
namespace MandelBrotCalc
2
{
3
    partial class Form1
4
    {
5
        /// <summary>
6
        /// Required designer variable.
7
        /// </summary>
8
        private System.ComponentModel.IContainer components = null;
9

10
        /// <summary>
11
        /// Clean up any resources being used.
12
        /// </summary>
13
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
        protected override void Dispose(bool disposing)
15
        {
16
            if (disposing && (components != null))
17
            {
18
                components.Dispose();
19
            }
20
            base.Dispose(disposing);
21
        }
22

23
        #region Windows Form Designer generated code
24

25
        /// <summary>
26
        /// Required method for Designer support - do not modify
27
        /// the contents of this method with the code editor.
28
        /// </summary>
29
        private void InitializeComponent()
30
        {
31
            this.outputFractalImage = new System.Windows.Forms.PictureBox();
32
            this.button1 = new System.Windows.Forms.Button();
33
            this.cIndex = new System.Windows.Forms.NumericUpDown();
34
            this.label1 = new System.Windows.Forms.Label();
35
            this.iterationsNumeric = new System.Windows.Forms.NumericUpDown();
36
            this.label2 = new System.Windows.Forms.Label();
37
            this.label3 = new System.Windows.Forms.Label();
38
            this.exportBtn = new System.Windows.Forms.Button();
39
            this.boundaryCoords = new System.Windows.Forms.Label();
40
            ((System.ComponentModel.ISupportInitialize)(this.outputFractalImage)).BeginInit();
41
            ((System.ComponentModel.ISupportInitialize)(this.cIndex)).BeginInit();
42
            ((System.ComponentModel.ISupportInitialize)(this.iterationsNumeric)).BeginInit();
43
            this.SuspendLayout();
44
            // 
45
            // outputFractalImage
46
            // 
47
            this.outputFractalImage.Location = new System.Drawing.Point(12, 12);
48
            this.outputFractalImage.Name = "outputFractalImage";
49
            this.outputFractalImage.Size = new System.Drawing.Size(800, 800);
50
            this.outputFractalImage.TabIndex = 0;
51
            this.outputFractalImage.TabStop = false;
52
            this.outputFractalImage.Paint += new System.Windows.Forms.PaintEventHandler(this.outputFractalImage_Paint);
53
            this.outputFractalImage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseDown);
54
            this.outputFractalImage.MouseMove += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseMove);
55
            this.outputFractalImage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.outputFractalImage_MouseUp);
56
            // 
57
            // button1
58
            // 
59
            this.button1.Location = new System.Drawing.Point(120, 820);
60
            this.button1.Name = "button1";
61
            this.button1.Size = new System.Drawing.Size(75, 23);
62
            this.button1.TabIndex = 1;
63
            this.button1.Text = "Reset";
64
            this.button1.UseVisualStyleBackColor = true;
65
            this.button1.Click += new System.EventHandler(this.button1_Click);
66
            // 
67
            // cIndex
68
            // 
69
            this.cIndex.Increment = new decimal(new int[] {
70
            50,
71
            0,
72
            0,
73
            0});
74
            this.cIndex.Location = new System.Drawing.Point(449, 820);
75
            this.cIndex.Maximum = new decimal(new int[] {
76
            10000,
77
            0,
78
            0,
79
            0});
80
            this.cIndex.Name = "cIndex";
81
            this.cIndex.Size = new System.Drawing.Size(78, 20);
82
            this.cIndex.TabIndex = 2;
83
            this.cIndex.Value = new decimal(new int[] {
84
            2500,
85
            0,
86
            0,
87
            0});
88
            // 
89
            // label1
90
            // 
91
            this.label1.AutoSize = true;
92
            this.label1.Location = new System.Drawing.Point(380, 823);
93
            this.label1.Name = "label1";
94
            this.label1.Size = new System.Drawing.Size(63, 13);
95
            this.label1.TabIndex = 3;
96
            this.label1.Text = "Color Index:";
97
            // 
98
            // iterationsNumeric
99
            // 
100
            this.iterationsNumeric.Increment = new decimal(new int[] {
101
            50,
102
            0,
103
            0,
104
            0});
105
            this.iterationsNumeric.Location = new System.Drawing.Point(291, 820);
106
            this.iterationsNumeric.Maximum = new decimal(new int[] {
107
            10000,
108
            0,
109
            0,
110
            0});
111
            this.iterationsNumeric.Name = "iterationsNumeric";
112
            this.iterationsNumeric.Size = new System.Drawing.Size(83, 20);
113
            this.iterationsNumeric.TabIndex = 4;
114
            this.iterationsNumeric.Value = new decimal(new int[] {
115
            1000,
116
            0,
117
            0,
118
            0});
119
            // 
120
            // label2
121
            // 
122
            this.label2.AutoSize = true;
123
            this.label2.Location = new System.Drawing.Point(201, 823);
124
            this.label2.Name = "label2";
125
            this.label2.Size = new System.Drawing.Size(84, 13);
126
            this.label2.TabIndex = 5;
127
            this.label2.Text = "Iterations Count:";
128
            // 
129
            // label3
130
            // 
131
            this.label3.AutoSize = true;
132
            this.label3.Location = new System.Drawing.Point(12, 818);
133
            this.label3.Name = "label3";
134
            this.label3.Size = new System.Drawing.Size(101, 26);
135
            this.label3.TabIndex = 6;
136
            this.label3.Text = "Software Written by\r\nStephen Downward";
137
            // 
138
            // exportBtn
139
            // 
140
            this.exportBtn.Location = new System.Drawing.Point(737, 820);
141
            this.exportBtn.Name = "exportBtn";
142
            this.exportBtn.Size = new System.Drawing.Size(75, 23);
143
            this.exportBtn.TabIndex = 7;
144
            this.exportBtn.Text = "Export";
145
            this.exportBtn.UseVisualStyleBackColor = true;
146
            this.exportBtn.Click += new System.EventHandler(this.exportBtn_Click);
147
            // 
148
            // boundaryCoords
149
            // 
150
            this.boundaryCoords.AutoSize = true;
151
            this.boundaryCoords.Location = new System.Drawing.Point(533, 818);
152
            this.boundaryCoords.Name = "boundaryCoords";
153
            this.boundaryCoords.Size = new System.Drawing.Size(50, 26);
154
            this.boundaryCoords.TabIndex = 8;
155
            this.boundaryCoords.Text = "X: -2 to 2\r\nY: -2 to 2\r\n";
156
            // 
157
            // Form1
158
            // 
159
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
160
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
161
            this.ClientSize = new System.Drawing.Size(826, 852);
162
            this.Controls.Add(this.boundaryCoords);
163
            this.Controls.Add(this.exportBtn);
164
            this.Controls.Add(this.label3);
165
            this.Controls.Add(this.label2);
166
            this.Controls.Add(this.iterationsNumeric);
167
            this.Controls.Add(this.label1);
168
            this.Controls.Add(this.cIndex);
169
            this.Controls.Add(this.button1);
170
            this.Controls.Add(this.outputFractalImage);
171
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
172
            this.MaximizeBox = false;
173
            this.Name = "Form1";
174
            this.ShowIcon = false;
175
            this.Text = "Mandlebrot calculator";
176
            ((System.ComponentModel.ISupportInitialize)(this.outputFractalImage)).EndInit();
177
            ((System.ComponentModel.ISupportInitialize)(this.cIndex)).EndInit();
178
            ((System.ComponentModel.ISupportInitialize)(this.iterationsNumeric)).EndInit();
179
            this.ResumeLayout(false);
180
            this.PerformLayout();
181

182
        }
183

184
        #endregion
185

186
        private System.Windows.Forms.PictureBox outputFractalImage;
187
        private System.Windows.Forms.Button button1;
188
        private System.Windows.Forms.NumericUpDown cIndex;
189
        private System.Windows.Forms.Label label1;
190
        private System.Windows.Forms.NumericUpDown iterationsNumeric;
191
        private System.Windows.Forms.Label label2;
192
        private System.Windows.Forms.Label label3;
193
        private System.Windows.Forms.Button exportBtn;
194
        private System.Windows.Forms.Label boundaryCoords;
195
    }
196
}
197


+ 192 - 194
MandelbrotCalc/Form1.cs

@ -1,195 +1,193 @@
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9
using System.Windows.Forms;
10
using System.Numerics;
11
using System.Drawing.Imaging;
12
13
namespace MandelBrotCalc
14
{
15
    public partial class Form1 : Form
16
    {
17
18
        private Point RectStartPoint;
19
        private Rectangle Rect = new Rectangle();
20
        private Brush selectionBrush = new SolidBrush(Color.FromArgb(128, 72, 145, 220));
21
22
        double minX = -2, minY = -2, maxX = 2, maxY = 2;
23
24
        public Form1()
25
        {
26
            InitializeComponent();
27
            button1_Click(null, null);
28
        }
29
30
        private void button1_Click(object sender, EventArgs e)
31
        {
32
            int cScale = (int)cIndex.Value;
33
            int iterations = (int)iterationsNumeric.Value;
34
35
            minX = -2;
36
            minY = -2;
37
            maxX = 2;
38
            maxY = 2;
39
40
            outputFractalImage.Image = generateFractal(outputFractalImage.Width, outputFractalImage.Height);
41
            Rect.Size = new Size(0, 0);
42
            outputFractalImage.Invalidate();
43
        }
44
45
        private void outputFractalImage_MouseMove(object sender, MouseEventArgs e)
46
        {
47
            if (e.Button != MouseButtons.Left)
48
                return;
49
            Point tempEndPoint = e.Location;
50
            Rect.Location = new Point(
51
                Math.Min(RectStartPoint.X, tempEndPoint.X),
52
                Math.Min(RectStartPoint.Y, tempEndPoint.Y));
53
            int SizeX = Math.Abs(RectStartPoint.X - tempEndPoint.X);
54
            int SizeY = Math.Abs(RectStartPoint.Y - tempEndPoint.Y);
55
            Rect.Size = new Size(SizeX, SizeY);
56
            outputFractalImage.Invalidate();
57
        }
58
59
        private void outputFractalImage_MouseUp(object sender, MouseEventArgs e)
60
        {
61
62
            //Change scale and redraw!
63
            //int RectSize = Math.Max(Rect.Width, Rect.Height); //Maintain aspect ratio!
64
            //int CenterX = Rect.X + Rect.Width / 2;
65
            //int CenterY = Rect.Y + Rect.Height / 2;
66
67
            double NminX = ConvertRange(0, outputFractalImage.Width, minX, maxX, Rect.X);
68
            double NmaxX = ConvertRange(0, outputFractalImage.Width, minX, maxX, Rect.X + Rect.Width);
69
            double NminY = ConvertRange(0, outputFractalImage.Height, minY, maxY, Rect.Y);
70
            double NmaxY = ConvertRange(0, outputFractalImage.Height, minY, maxY, Rect.Y + Rect.Height);
71
72
            double difX = NmaxX - NminX;
73
            double difY = NmaxY - NminY;
74
            if (difX < difY)
75
            {
76
                NmaxX += (difY - difX) / 2;
77
                NminX -= (difY - difX) / 2;
78
            }
79
            else if (difX > difY)
80
            {
81
                NmaxY += (difX - difY) / 2;
82
                NminY -= (difX - difY) / 2;
83
            }
84
85
            minX = NminX;
86
            maxX = NmaxX;
87
            minY = NminY;
88
            maxY = NmaxY;
89
90
            boundaryCoords.Text = "X: " + Math.Round(minX, 10) + " to " + Math.Round(maxX, 10) + "\r\nY: " + Math.Round(minY, 10) + " to " + Math.Round(maxY, 10);
91
92
            outputFractalImage.Image = generateFractal(outputFractalImage.Width, outputFractalImage.Height);
93
            Rect.Size = new Size(0, 0);
94
            outputFractalImage.Invalidate();
95
        }
96
97
        private Image generateFractal(int width, int height)
98
        {
99
            int cScale = (int)cIndex.Value;
100
            int iterations = (int)iterationsNumeric.Value;
101
102
            var tile = new Bitmap(width, height);
103
            unsafe
104
            {
105
                int h = tile.Height;
106
                int w = tile.Width;
107
108
                //Move this to its own function
109
                BitmapData bitmapData = tile.LockBits(new Rectangle(0, 0, tile.Width, tile.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
110
                int bytesPerPixel = System.Drawing.Bitmap.GetPixelFormatSize(tile.PixelFormat) / 8;
111
                int heightInPixels = bitmapData.Height;
112
                int widthInBytes = bitmapData.Width * bytesPerPixel;
113
                byte* ptrFirstPixel = (byte*)bitmapData.Scan0;
114
115
                Parallel.For(0, tile.Height, new ParallelOptions { MaxDegreeOfParallelism = 16 }, y =>//int x = 0; x < imageFrame.Width; x++)
116
                {
117
                    byte* currentLine = ptrFirstPixel + (y * bitmapData.Stride);
118
119
                    for (int x = 0; x < w; x++)
120
                    {
121
                        double Ci = ConvertRange(0, h, minY, maxY, y);
122
                        double Cr = ConvertRange(0, w, minX, maxX, x);
123
                        int r = rateOfDiversion(Cr, Ci, cScale, iterations);
124
                        int B = r / 65536;
125
                        int G = (r / 256) % 256 ^ 2;
126
                        int R = r % 256;
127
128
                        currentLine[x * bytesPerPixel] = (byte)B;
129
                        currentLine[x * bytesPerPixel + 1] = (byte)G;
130
                        currentLine[x * bytesPerPixel + 2] = (byte)R;
131
                        currentLine[x * bytesPerPixel + 3] = 255;
132
                    }
133
                });
134
                //SourceImage.UnlockBits(srcData);
135
136
                tile.UnlockBits(bitmapData);
137
            }
138
            return tile;
139
        }
140
141
        private void outputFractalImage_Paint(object sender, PaintEventArgs e)
142
        {
143
            if (outputFractalImage.Image != null)
144
            {
145
                if (Rect != null && Rect.Width > 0 && Rect.Height > 0)
146
                {
147
                    e.Graphics.FillRectangle(selectionBrush, Rect);
148
                }
149
            }
150
        }
151
152
        private void exportBtn_Click(object sender, EventArgs e)
153
        {
154
            SaveFileDialog saveDialog = new SaveFileDialog();
155
            saveDialog.Filter = "PNG image (*.png)|*.png";
156
            saveDialog.DefaultExt = "png";
157
            if(saveDialog.ShowDialog() == DialogResult.OK)
158
            {
159
                //Generate and save
160
                Image img = generateFractal(1920 * 4, 1920 * 4);
161
                img.Save(saveDialog.FileName);
162
                MessageBox.Show("Image saved");
163
            }
164
        }
165
166
        private int rateOfDiversion(double Creal, double Cimaginary, int colorScale, int totalIterations)
167
        {
168
            //double C = Creal + Cimaginary;
169
            //double Z = 0;
170
            Complex cZ = new Complex(0, 0);
171
            Complex cC = new Complex(Creal, Cimaginary);
172
            int numRecursions = 0;
173
            while(cZ.Magnitude < 2)
174
            {
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9
using System.Windows.Forms;
10
using System.Drawing.Imaging;
11

12
namespace MandelBrotCalc
13
{
14
    public partial class Form1 : Form
15
    {
16
        private Point RectStartPoint;
17
        private Rectangle Rect = new Rectangle();
18
        private Brush selectionBrush = new SolidBrush(Color.FromArgb(128, 72, 145, 220));
19

20
        double minX = -2, minY = -2, maxX = 2, maxY = 2;
21

22
        public Form1()
23
        {
24
            InitializeComponent();
25
            button1_Click(null, null);
26
        }
27

28
        private void button1_Click(object sender, EventArgs e)
29
        {
30
            int cScale = (int)cIndex.Value;
31
            int iterations = (int)iterationsNumeric.Value;
32

33
            minX = -2;
34
            minY = -2;
35
            maxX = 2;
36
            maxY = 2;
37

38
            outputFractalImage.Image = generateFractal(outputFractalImage.Width, outputFractalImage.Height);
39
            Rect.Size = new Size(0, 0);
40
            outputFractalImage.Invalidate();
41
        }
42

43
        private void outputFractalImage_MouseMove(object sender, MouseEventArgs e)
44
        {
45
            if (e.Button != MouseButtons.Left)
46
                return;
47
            Point tempEndPoint = e.Location;
48
            Rect.Location = new Point(
49
                Math.Min(RectStartPoint.X, tempEndPoint.X),
50
                Math.Min(RectStartPoint.Y, tempEndPoint.Y));
51
            int SizeX = Math.Abs(RectStartPoint.X - tempEndPoint.X);
52
            int SizeY = Math.Abs(RectStartPoint.Y - tempEndPoint.Y);
53
            Rect.Size = new Size(SizeX, SizeY);
54
            outputFractalImage.Invalidate();
55
        }
56

57
        private void outputFractalImage_MouseUp(object sender, MouseEventArgs e)
58
        {
59

60
            //Change scale and redraw!
61
            //int RectSize = Math.Max(Rect.Width, Rect.Height); //Maintain aspect ratio!
62
            //int CenterX = Rect.X + Rect.Width / 2;
63
            //int CenterY = Rect.Y + Rect.Height / 2;
64

65
            double NminX = ConvertRange(0, outputFractalImage.Width, minX, maxX, Rect.X);
66
            double NmaxX = ConvertRange(0, outputFractalImage.Width, minX, maxX, Rect.X + Rect.Width);
67
            double NminY = ConvertRange(0, outputFractalImage.Height, minY, maxY, Rect.Y);
68
            double NmaxY = ConvertRange(0, outputFractalImage.Height, minY, maxY, Rect.Y + Rect.Height);
69

70
            double difX = NmaxX - NminX;
71
            double difY = NmaxY - NminY;
72
            if (difX < difY)
73
            {
74
                NmaxX += (difY - difX) / 2;
75
                NminX -= (difY - difX) / 2;
76
            }
77
            else if (difX > difY)
78
            {
79
                NmaxY += (difX - difY) / 2;
80
                NminY -= (difX - difY) / 2;
81
            }
82

83
            minX = NminX;
84
            maxX = NmaxX;
85
            minY = NminY;
86
            maxY = NmaxY;
87

88
            boundaryCoords.Text = "X: " + Math.Round(minX, 10) + " to " + Math.Round(maxX, 10) + "\r\nY: " + Math.Round(minY, 10) + " to " + Math.Round(maxY, 10);
89

90
            outputFractalImage.Image = generateFractal(outputFractalImage.Width, outputFractalImage.Height);
91
            Rect.Size = new Size(0, 0);
92
            outputFractalImage.Invalidate();
93
        }
94

95
        private Image generateFractal(int width, int height)
96
        {
97
            int cScale = (int)cIndex.Value;
98
            int iterations = (int)iterationsNumeric.Value;
99

100
            var tile = new Bitmap(width, height);
101
            unsafe
102
            {
103
                int h = tile.Height;
104
                int w = tile.Width;
105

106
                //Move this to its own function
107
                BitmapData bitmapData = tile.LockBits(new Rectangle(0, 0, tile.Width, tile.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
108
                int bytesPerPixel = System.Drawing.Bitmap.GetPixelFormatSize(tile.PixelFormat) / 8;
109
                int heightInPixels = bitmapData.Height;
110
                int widthInBytes = bitmapData.Width * bytesPerPixel;
111
                byte* ptrFirstPixel = (byte*)bitmapData.Scan0;
112

113
                Parallel.For(0, tile.Height, new ParallelOptions { MaxDegreeOfParallelism = 16 }, y =>//int x = 0; x < imageFrame.Width; x++)
114
                {
115
                    byte* currentLine = ptrFirstPixel + (y * bitmapData.Stride);
116

117
                    for (int x = 0; x < w; x++)
118
                    {
119
                        double Ci = ConvertRange(0, h, minY, maxY, y);
120
                        double Cr = ConvertRange(0, w, minX, maxX, x);
121
                        int r = rateOfDiversion(Cr, Ci, cScale, iterations);
122
						int B = r / 65536;
123
						int G = (r / 256) % 256 ^ 2;
124
						int R = r % 256;
125

126
                        currentLine[x * bytesPerPixel] = (byte)B;
127
                        currentLine[x * bytesPerPixel + 1] = (byte)G;
128
                        currentLine[x * bytesPerPixel + 2] = (byte)R;
129
                        currentLine[x * bytesPerPixel + 3] = 255;
130
                    }
131
                });
132
                //SourceImage.UnlockBits(srcData);
133

134
                tile.UnlockBits(bitmapData);
135
            }
136
            return tile;
137
        }
138

139
        private void outputFractalImage_Paint(object sender, PaintEventArgs e)
140
        {
141
            if (outputFractalImage.Image != null)
142
            {
143
                if (Rect != null && Rect.Width > 0 && Rect.Height > 0)
144
                {
145
                    e.Graphics.FillRectangle(selectionBrush, Rect);
146
                }
147
            }
148
        }
149

150
        private void exportBtn_Click(object sender, EventArgs e)
151
        {
152
            SaveFileDialog saveDialog = new SaveFileDialog();
153
            saveDialog.Filter = "PNG image (*.png)|*.png";
154
            saveDialog.DefaultExt = "png";
155
            if(saveDialog.ShowDialog() == DialogResult.OK)
156
            {
157
                //Generate and save
158
                Image img = generateFractal(1920 * 4, 1920 * 4);
159
                img.Save(saveDialog.FileName);
160
                MessageBox.Show("Image saved");
161
            }
162
        }
163

164
        private int rateOfDiversion(double Creal, double Cimaginary, int colorScale, int totalIterations)
165
        {
166
            int numRecursions = 0;
167
			double Zr = 0;
168
			double Zrtemp = 0;
169
			double Zi = 0;
170
			while(Math.Sqrt(Zr * Zr + Zi * Zi) < 2)
171
            {
175 172
                numRecursions++;
176
                cZ = cZ * cZ + cC;
177
                //Z = Z * Z + C;
178
                if (numRecursions > totalIterations) return 0; //Convergent
179
            }
180
            return (int)ConvertRange(0, colorScale, 0, 16777215, numRecursions);
181
        }
182
183
        public static double ConvertRange(double originalStart, double originalEnd, double newStart, double newEnd, double value)
184
        {
185
            double scale = (double)(newEnd - newStart) / (originalEnd - originalStart);
186
            return (newStart + ((value - originalStart) * scale));
187
        }
188
189
        private void outputFractalImage_MouseDown(object sender, MouseEventArgs e)
190
        {
191
            RectStartPoint = e.Location;
192
            Invalidate();
193
        }
194
    }
195
}
173
				Zrtemp = Zr * Zr + Creal - (Zi * Zi);
174
				Zi = 2 * Zi * Zr + Cimaginary;
175
				Zr = Zrtemp;
176
                if (numRecursions > totalIterations) return 0; //Convergent
177
            }
178
			return (int)ConvertRange(0, colorScale, 0, 16777215, numRecursions);
179
        }
180

181
        public static double ConvertRange(double originalStart, double originalEnd, double newStart, double newEnd, double value)
182
        {
183
            double scale = (double)(newEnd - newStart) / (originalEnd - originalStart);
184
            return (newStart + ((value - originalStart) * scale));
185
        }
186

187
        private void outputFractalImage_MouseDown(object sender, MouseEventArgs e)
188
        {
189
            RectStartPoint = e.Location;
190
            Invalidate();
191
        }
192
    }
193
}

+ 119 - 119
MandelbrotCalc/Form1.resx

@ -1,120 +1,120 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<root>
3
  <!-- 
4
    Microsoft ResX Schema 
5
    
6
    Version 2.0
7
    
8
    The primary goals of this format is to allow a simple XML format 
9
    that is mostly human readable. The generation and parsing of the 
10
    various data types are done through the TypeConverter classes 
11
    associated with the data types.
12
    
13
    Example:
14
    
15
    ... ado.net/XML headers & schema ...
16
    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
    <resheader name="version">2.0</resheader>
18
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
    </data>
25
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
        <comment>This is a comment</comment>
28
    </data>
29
                
30
    There are any number of "resheader" rows that contain simple 
31
    name/value pairs.
32
    
33
    Each data row contains a name, and value. The row also contains a 
34
    type or mimetype. Type corresponds to a .NET class that support 
35
    text/value conversion through the TypeConverter architecture. 
36
    Classes that don't support this are serialized and stored with the 
37
    mimetype set.
38
    
39
    The mimetype is used for serialized objects, and tells the 
40
    ResXResourceReader how to depersist the object. This is currently not 
41
    extensible. For a given mimetype the value must be set accordingly:
42
    
43
    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
    that the ResXResourceWriter will generate, however the reader can 
45
    read any of the formats listed below.
46
    
47
    mimetype: application/x-microsoft.net.object.binary.base64
48
    value   : The object must be serialized with 
49
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
            : and then encoded with base64 encoding.
51
    
52
    mimetype: application/x-microsoft.net.object.soap.base64
53
    value   : The object must be serialized with 
54
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
            : and then encoded with base64 encoding.
56
57
    mimetype: application/x-microsoft.net.object.bytearray.base64
58
    value   : The object must be serialized into a byte array 
59
            : using a System.ComponentModel.TypeConverter
60
            : and then encoded with base64 encoding.
61
    -->
62
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
    <xsd:element name="root" msdata:IsDataSet="true">
65
      <xsd:complexType>
66
        <xsd:choice maxOccurs="unbounded">
67
          <xsd:element name="metadata">
68
            <xsd:complexType>
69
              <xsd:sequence>
70
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
              </xsd:sequence>
72
              <xsd:attribute name="name" use="required" type="xsd:string" />
73
              <xsd:attribute name="type" type="xsd:string" />
74
              <xsd:attribute name="mimetype" type="xsd:string" />
75
              <xsd:attribute ref="xml:space" />
76
            </xsd:complexType>
77
          </xsd:element>
78
          <xsd:element name="assembly">
79
            <xsd:complexType>
80
              <xsd:attribute name="alias" type="xsd:string" />
81
              <xsd:attribute name="name" type="xsd:string" />
82
            </xsd:complexType>
83
          </xsd:element>
84
          <xsd:element name="data">
85
            <xsd:complexType>
86
              <xsd:sequence>
87
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
              </xsd:sequence>
90
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
              <xsd:attribute ref="xml:space" />
94
            </xsd:complexType>
95
          </xsd:element>
96
          <xsd:element name="resheader">
97
            <xsd:complexType>
98
              <xsd:sequence>
99
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
              </xsd:sequence>
101
              <xsd:attribute name="name" type="xsd:string" use="required" />
102
            </xsd:complexType>
103
          </xsd:element>
104
        </xsd:choice>
105
      </xsd:complexType>
106
    </xsd:element>
107
  </xsd:schema>
108
  <resheader name="resmimetype">
109
    <value>text/microsoft-resx</value>
110
  </resheader>
111
  <resheader name="version">
112
    <value>2.0</value>
113
  </resheader>
114
  <resheader name="reader">
115
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
  </resheader>
117
  <resheader name="writer">
118
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
  </resheader>
1
<?xml version="1.0" encoding="utf-8"?>
2
<root>
3
  <!-- 
4
    Microsoft ResX Schema 
5
    
6
    Version 2.0
7
    
8
    The primary goals of this format is to allow a simple XML format 
9
    that is mostly human readable. The generation and parsing of the 
10
    various data types are done through the TypeConverter classes 
11
    associated with the data types.
12
    
13
    Example:
14
    
15
    ... ado.net/XML headers & schema ...
16
    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
    <resheader name="version">2.0</resheader>
18
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
    </data>
25
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
        <comment>This is a comment</comment>
28
    </data>
29
                
30
    There are any number of "resheader" rows that contain simple 
31
    name/value pairs.
32
    
33
    Each data row contains a name, and value. The row also contains a 
34
    type or mimetype. Type corresponds to a .NET class that support 
35
    text/value conversion through the TypeConverter architecture. 
36
    Classes that don't support this are serialized and stored with the 
37
    mimetype set.
38
    
39
    The mimetype is used for serialized objects, and tells the 
40
    ResXResourceReader how to depersist the object. This is currently not 
41
    extensible. For a given mimetype the value must be set accordingly:
42
    
43
    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
    that the ResXResourceWriter will generate, however the reader can 
45
    read any of the formats listed below.
46
    
47
    mimetype: application/x-microsoft.net.object.binary.base64
48
    value   : The object must be serialized with 
49
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
            : and then encoded with base64 encoding.
51
    
52
    mimetype: application/x-microsoft.net.object.soap.base64
53
    value   : The object must be serialized with 
54
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
            : and then encoded with base64 encoding.
56

57
    mimetype: application/x-microsoft.net.object.bytearray.base64
58
    value   : The object must be serialized into a byte array 
59
            : using a System.ComponentModel.TypeConverter
60
            : and then encoded with base64 encoding.
61
    -->
62
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
    <xsd:element name="root" msdata:IsDataSet="true">
65
      <xsd:complexType>
66
        <xsd:choice maxOccurs="unbounded">
67
          <xsd:element name="metadata">
68
            <xsd:complexType>
69
              <xsd:sequence>
70
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
              </xsd:sequence>
72
              <xsd:attribute name="name" use="required" type="xsd:string" />
73
              <xsd:attribute name="type" type="xsd:string" />
74
              <xsd:attribute name="mimetype" type="xsd:string" />
75
              <xsd:attribute ref="xml:space" />
76
            </xsd:complexType>
77
          </xsd:element>
78
          <xsd:element name="assembly">
79
            <xsd:complexType>
80
              <xsd:attribute name="alias" type="xsd:string" />
81
              <xsd:attribute name="name" type="xsd:string" />
82
            </xsd:complexType>
83
          </xsd:element>
84
          <xsd:element name="data">
85
            <xsd:complexType>
86
              <xsd:sequence>
87
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
              </xsd:sequence>
90
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
              <xsd:attribute ref="xml:space" />
94
            </xsd:complexType>
95
          </xsd:element>
96
          <xsd:element name="resheader">
97
            <xsd:complexType>
98
              <xsd:sequence>
99
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
              </xsd:sequence>
101
              <xsd:attribute name="name" type="xsd:string" use="required" />
102
            </xsd:complexType>
103
          </xsd:element>
104
        </xsd:choice>
105
      </xsd:complexType>
106
    </xsd:element>
107
  </xsd:schema>
108
  <resheader name="resmimetype">
109
    <value>text/microsoft-resx</value>
110
  </resheader>
111
  <resheader name="version">
112
    <value>2.0</value>
113
  </resheader>
114
  <resheader name="reader">
115
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
  </resheader>
117
  <resheader name="writer">
118
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
  </resheader>
120 120
</root>

+ 0 - 94
MandelbrotCalc/MandelBrotCalc.csproj

@ -1,94 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
  <PropertyGroup>
5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
    <ProjectGuid>{EF39B46E-33FE-461C-8F4F-1936E6189BD4}</ProjectGuid>
8
    <OutputType>WinExe</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>MandelbrotCalc</RootNamespace>
11
    <AssemblyName>MandelBrotCalc</AssemblyName>
12
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15
  </PropertyGroup>
16
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
    <PlatformTarget>AnyCPU</PlatformTarget>
18
    <DebugSymbols>true</DebugSymbols>
19
    <DebugType>full</DebugType>
20
    <Optimize>false</Optimize>
21
    <OutputPath>bin\Debug\</OutputPath>
22
    <DefineConstants>DEBUG;TRACE</DefineConstants>
23
    <ErrorReport>prompt</ErrorReport>
24
    <WarningLevel>4</WarningLevel>
25
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
26
  </PropertyGroup>
27
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28
    <PlatformTarget>AnyCPU</PlatformTarget>
29
    <DebugType>pdbonly</DebugType>
30
    <Optimize>true</Optimize>
31
    <OutputPath>bin\Release\</OutputPath>
32
    <DefineConstants>TRACE</DefineConstants>
33
    <ErrorReport>prompt</ErrorReport>
34
    <WarningLevel>4</WarningLevel>
35
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
36
  </PropertyGroup>
37
  <ItemGroup>
38
    <Reference Include="System" />
39
    <Reference Include="System.Core" />
40
    <Reference Include="System.Numerics" />
41
    <Reference Include="System.Xml.Linq" />
42
    <Reference Include="System.Data.DataSetExtensions" />
43
    <Reference Include="Microsoft.CSharp" />
44
    <Reference Include="System.Data" />
45
    <Reference Include="System.Deployment" />
46
    <Reference Include="System.Drawing" />
47
    <Reference Include="System.Net.Http" />
48
    <Reference Include="System.Windows.Forms" />
49
    <Reference Include="System.Xml" />
50
  </ItemGroup>
51
  <ItemGroup>
52
    <Compile Include="Form1.cs">
53
      <SubType>Form</SubType>
54
    </Compile>
55
    <Compile Include="Form1.Designer.cs">
56
      <DependentUpon>Form1.cs</DependentUpon>
57
    </Compile>
58
    <Compile Include="Program.cs" />
59
    <Compile Include="Properties\AssemblyInfo.cs" />
60
    <EmbeddedResource Include="Form1.resx">
61
      <DependentUpon>Form1.cs</DependentUpon>
62
    </EmbeddedResource>
63
    <EmbeddedResource Include="Properties\Resources.resx">
64
      <Generator>ResXFileCodeGenerator</Generator>
65
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
66
      <SubType>Designer</SubType>
67
    </EmbeddedResource>
68
    <Compile Include="Properties\Resources.Designer.cs">
69
      <AutoGen>True</AutoGen>
70
      <DependentUpon>Resources.resx</DependentUpon>
71
      <DesignTime>True</DesignTime>
72
    </Compile>
73
    <None Include="Properties\Settings.settings">
74
      <Generator>SettingsSingleFileGenerator</Generator>
75
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
76
    </None>
77
    <Compile Include="Properties\Settings.Designer.cs">
78
      <AutoGen>True</AutoGen>
79
      <DependentUpon>Settings.settings</DependentUpon>
80
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
81
    </Compile>
82
  </ItemGroup>
83
  <ItemGroup>
84
    <None Include="App.config" />
85
  </ItemGroup>
86
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
87
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
88
       Other similar extension points exist, see Microsoft.Common.targets.
89
  <Target Name="BeforeBuild">
90
  </Target>
91
  <Target Name="AfterBuild">
92
  </Target>
93
  -->
94
</Project>

+ 22 - 22
MandelbrotCalc/Program.cs

@ -1,22 +1,22 @@
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Threading.Tasks;
5
using System.Windows.Forms;
6
7
namespace MandelBrotCalc
8
{
9
    static class Program
10
    {
11
        /// <summary>
12
        /// The main entry point for the application.
13
        /// </summary>
14
        [STAThread]
15
        static void Main()
16
        {
17
            Application.EnableVisualStyles();
18
            Application.SetCompatibleTextRenderingDefault(false);
19
            Application.Run(new Form1());
20
        }
21
    }
22
}
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Threading.Tasks;
5
using System.Windows.Forms;
6

7
namespace MandelBrotCalc
8
{
9
    static class Program
10
    {
11
        /// <summary>
12
        /// The main entry point for the application.
13
        /// </summary>
14
        [STAThread]
15
        static void Main()
16
        {
17
            Application.EnableVisualStyles();
18
            Application.SetCompatibleTextRenderingDefault(false);
19
            Application.Run(new Form1());
20
        }
21
    }
22
}

+ 36 - 36
MandelbrotCalc/Properties/AssemblyInfo.cs

@ -1,36 +1,36 @@
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4
5
// General Information about an assembly is controlled through the following 
6
// set of attributes. Change these attribute values to modify the information
7
// associated with an assembly.
8
[assembly: AssemblyTitle("MandelbrotCalc")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("MandelbrotCalc")]
13
[assembly: AssemblyCopyright("Copyright ©  2017")]
14
[assembly: AssemblyTrademark("")]
15
[assembly: AssemblyCulture("")]
16
17
// Setting ComVisible to false makes the types in this assembly not visible 
18
// to COM components.  If you need to access a type in this assembly from 
19
// COM, set the ComVisible attribute to true on that type.
20
[assembly: ComVisible(false)]
21
22
// The following GUID is for the ID of the typelib if this project is exposed to COM
23
[assembly: Guid("ef39b46e-33fe-461c-8f4f-1936e6189bd4")]
24
25
// Version information for an assembly consists of the following four values:
26
//
27
//      Major Version
28
//      Minor Version 
29
//      Build Number
30
//      Revision
31
//
32
// You can specify all the values or you can default the Build and Revision Numbers 
33
// by using the '*' as shown below:
34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.0.0")]
36
[assembly: AssemblyFileVersion("1.0.0.0")]
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

5
// General Information about an assembly is controlled through the following 
6
// set of attributes. Change these attribute values to modify the information
7
// associated with an assembly.
8
[assembly: AssemblyTitle("MandelbrotCalc")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("MandelbrotCalc")]
13
[assembly: AssemblyCopyright("Copyright ©  2017")]
14
[assembly: AssemblyTrademark("")]
15
[assembly: AssemblyCulture("")]
16

17
// Setting ComVisible to false makes the types in this assembly not visible 
18
// to COM components.  If you need to access a type in this assembly from 
19
// COM, set the ComVisible attribute to true on that type.
20
[assembly: ComVisible(false)]
21

22
// The following GUID is for the ID of the typelib if this project is exposed to COM
23
[assembly: Guid("ef39b46e-33fe-461c-8f4f-1936e6189bd4")]
24

25
// Version information for an assembly consists of the following four values:
26
//
27
//      Major Version
28
//      Minor Version 
29
//      Build Number
30
//      Revision
31
//
32
// You can specify all the values or you can default the Build and Revision Numbers 
33
// by using the '*' as shown below:
34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.0.0")]
36
[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 63
MandelbrotCalc/Properties/Resources.Designer.cs

@ -1,63 +1,63 @@
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     This code was generated by a tool.
4
//     Runtime Version:4.0.30319.42000
5
//
6
//     Changes to this file may cause incorrect behavior and will be lost if
7
//     the code is regenerated.
8
// </auto-generated>
9
//------------------------------------------------------------------------------
10
11
namespace MandelBrotCalc.Properties {
12
    using System;
13
    
14
    
15
    /// <summary>
16
    ///   A strongly-typed resource class, for looking up localized strings, etc.
17
    /// </summary>
18
    // This class was auto-generated by the StronglyTypedResourceBuilder
19
    // class via a tool like ResGen or Visual Studio.
20
    // To add or remove a member, edit your .ResX file then rerun ResGen
21
    // with the /str option, or rebuild your VS project.
22
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25
    internal class Resources {
26
        
27
        private static global::System.Resources.ResourceManager resourceMan;
28
        
29
        private static global::System.Globalization.CultureInfo resourceCulture;
30
        
31
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32
        internal Resources() {
33
        }
34
        
35
        /// <summary>
36
        ///   Returns the cached ResourceManager instance used by this class.
37
        /// </summary>
38
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39
        internal static global::System.Resources.ResourceManager ResourceManager {
40
            get {
41
                if (object.ReferenceEquals(resourceMan, null)) {
42
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MandelbrotCalc.Properties.Resources", typeof(Resources).Assembly);
43
                    resourceMan = temp;
44
                }
45
                return resourceMan;
46
            }
47
        }
48
        
49
        /// <summary>
50
        ///   Overrides the current thread's CurrentUICulture property for all
51
        ///   resource lookups using this strongly typed resource class.
52
        /// </summary>
53
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54
        internal static global::System.Globalization.CultureInfo Culture {
55
            get {
56
                return resourceCulture;
57
            }
58
            set {
59
                resourceCulture = value;
60
            }
61
        }
62
    }
63
}
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     This code was generated by a tool.
4
//     Runtime Version:4.0.30319.42000
5
//
6
//     Changes to this file may cause incorrect behavior and will be lost if
7
//     the code is regenerated.
8
// </auto-generated>
9
//------------------------------------------------------------------------------
10

11
namespace MandelBrotCalc.Properties {
12
    using System;
13
    
14
    
15
    /// <summary>
16
    ///   A strongly-typed resource class, for looking up localized strings, etc.
17
    /// </summary>
18
    // This class was auto-generated by the StronglyTypedResourceBuilder
19
    // class via a tool like ResGen or Visual Studio.
20
    // To add or remove a member, edit your .ResX file then rerun ResGen
21
    // with the /str option, or rebuild your VS project.
22
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25
    internal class Resources {
26
        
27
        private static global::System.Resources.ResourceManager resourceMan;
28
        
29
        private static global::System.Globalization.CultureInfo resourceCulture;
30
        
31
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32
        internal Resources() {
33
        }
34
        
35
        /// <summary>
36
        ///   Returns the cached ResourceManager instance used by this class.
37
        /// </summary>
38
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39
        internal static global::System.Resources.ResourceManager ResourceManager {
40
            get {
41
                if (object.ReferenceEquals(resourceMan, null)) {
42
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MandelbrotCalc.Properties.Resources", typeof(Resources).Assembly);
43
                    resourceMan = temp;
44
                }
45
                return resourceMan;
46
            }
47
        }
48
        
49
        /// <summary>
50
        ///   Overrides the current thread's CurrentUICulture property for all
51
        ///   resource lookups using this strongly typed resource class.
52
        /// </summary>
53
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54
        internal static global::System.Globalization.CultureInfo Culture {
55
            get {
56
                return resourceCulture;
57
            }
58
            set {
59
                resourceCulture = value;
60
            }
61
        }
62
    }
63
}

+ 116 - 116
MandelbrotCalc/Properties/Resources.resx

@ -1,117 +1,117 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<root>
3
  <!-- 
4
    Microsoft ResX Schema 
5
    
6
    Version 2.0
7
    
8
    The primary goals of this format is to allow a simple XML format 
9
    that is mostly human readable. The generation and parsing of the 
10
    various data types are done through the TypeConverter classes 
11
    associated with the data types.
12
    
13
    Example:
14
    
15
    ... ado.net/XML headers & schema ...
16
    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
    <resheader name="version">2.0</resheader>
18
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
    </data>
25
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
        <comment>This is a comment</comment>
28
    </data>
29
                
30
    There are any number of "resheader" rows that contain simple 
31
    name/value pairs.
32
    
33
    Each data row contains a name, and value. The row also contains a 
34
    type or mimetype. Type corresponds to a .NET class that support 
35
    text/value conversion through the TypeConverter architecture. 
36
    Classes that don't support this are serialized and stored with the 
37
    mimetype set.
38
    
39
    The mimetype is used for serialized objects, and tells the 
40
    ResXResourceReader how to depersist the object. This is currently not 
41
    extensible. For a given mimetype the value must be set accordingly:
42
    
43
    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
    that the ResXResourceWriter will generate, however the reader can 
45
    read any of the formats listed below.
46
    
47
    mimetype: application/x-microsoft.net.object.binary.base64
48
    value   : The object must be serialized with 
49
            : System.Serialization.Formatters.Binary.BinaryFormatter
50
            : and then encoded with base64 encoding.
51
    
52
    mimetype: application/x-microsoft.net.object.soap.base64
53
    value   : The object must be serialized with 
54
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
            : and then encoded with base64 encoding.
56
57
    mimetype: application/x-microsoft.net.object.bytearray.base64
58
    value   : The object must be serialized into a byte array 
59
            : using a System.ComponentModel.TypeConverter
60
            : and then encoded with base64 encoding.
61
    -->
62
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
    <xsd:element name="root" msdata:IsDataSet="true">
64
      <xsd:complexType>
65
        <xsd:choice maxOccurs="unbounded">
66
          <xsd:element name="metadata">
67
            <xsd:complexType>
68
              <xsd:sequence>
69
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
70
              </xsd:sequence>
71
              <xsd:attribute name="name" type="xsd:string" />
72
              <xsd:attribute name="type" type="xsd:string" />
73
              <xsd:attribute name="mimetype" type="xsd:string" />
74
            </xsd:complexType>
75
          </xsd:element>
76
          <xsd:element name="assembly">
77
            <xsd:complexType>
78
              <xsd:attribute name="alias" type="xsd:string" />
79
              <xsd:attribute name="name" type="xsd:string" />
80
            </xsd:complexType>
81
          </xsd:element>
82
          <xsd:element name="data">
83
            <xsd:complexType>
84
              <xsd:sequence>
85
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87
              </xsd:sequence>
88
              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91
            </xsd:complexType>
92
          </xsd:element>
93
          <xsd:element name="resheader">
94
            <xsd:complexType>
95
              <xsd:sequence>
96
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97
              </xsd:sequence>
98
              <xsd:attribute name="name" type="xsd:string" use="required" />
99
            </xsd:complexType>
100
          </xsd:element>
101
        </xsd:choice>
102
      </xsd:complexType>
103
    </xsd:element>
104
  </xsd:schema>
105
  <resheader name="resmimetype">
106
    <value>text/microsoft-resx</value>
107
  </resheader>
108
  <resheader name="version">
109
    <value>2.0</value>
110
  </resheader>
111
  <resheader name="reader">
112
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113
  </resheader>
114
  <resheader name="writer">
115
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
  </resheader>
1
<?xml version="1.0" encoding="utf-8"?>
2
<root>
3
  <!-- 
4
    Microsoft ResX Schema 
5
    
6
    Version 2.0
7
    
8
    The primary goals of this format is to allow a simple XML format 
9
    that is mostly human readable. The generation and parsing of the 
10
    various data types are done through the TypeConverter classes 
11
    associated with the data types.
12
    
13
    Example:
14
    
15
    ... ado.net/XML headers & schema ...
16
    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
    <resheader name="version">2.0</resheader>
18
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
    </data>
25
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
        <comment>This is a comment</comment>
28
    </data>
29
                
30
    There are any number of "resheader" rows that contain simple 
31
    name/value pairs.
32
    
33
    Each data row contains a name, and value. The row also contains a 
34
    type or mimetype. Type corresponds to a .NET class that support 
35
    text/value conversion through the TypeConverter architecture. 
36
    Classes that don't support this are serialized and stored with the 
37
    mimetype set.
38
    
39
    The mimetype is used for serialized objects, and tells the 
40
    ResXResourceReader how to depersist the object. This is currently not 
41
    extensible. For a given mimetype the value must be set accordingly:
42
    
43
    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
    that the ResXResourceWriter will generate, however the reader can 
45
    read any of the formats listed below.
46
    
47
    mimetype: application/x-microsoft.net.object.binary.base64
48
    value   : The object must be serialized with 
49
            : System.Serialization.Formatters.Binary.BinaryFormatter
50
            : and then encoded with base64 encoding.
51
    
52
    mimetype: application/x-microsoft.net.object.soap.base64
53
    value   : The object must be serialized with 
54
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
            : and then encoded with base64 encoding.
56

57
    mimetype: application/x-microsoft.net.object.bytearray.base64
58
    value   : The object must be serialized into a byte array 
59
            : using a System.ComponentModel.TypeConverter
60
            : and then encoded with base64 encoding.
61
    -->
62
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
    <xsd:element name="root" msdata:IsDataSet="true">
64
      <xsd:complexType>
65
        <xsd:choice maxOccurs="unbounded">
66
          <xsd:element name="metadata">
67
            <xsd:complexType>
68
              <xsd:sequence>
69
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
70
              </xsd:sequence>
71
              <xsd:attribute name="name" type="xsd:string" />
72
              <xsd:attribute name="type" type="xsd:string" />
73
              <xsd:attribute name="mimetype" type="xsd:string" />
74
            </xsd:complexType>
75
          </xsd:element>
76
          <xsd:element name="assembly">
77
            <xsd:complexType>
78
              <xsd:attribute name="alias" type="xsd:string" />
79
              <xsd:attribute name="name" type="xsd:string" />
80
            </xsd:complexType>
81
          </xsd:element>
82
          <xsd:element name="data">
83
            <xsd:complexType>
84
              <xsd:sequence>
85
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87
              </xsd:sequence>
88
              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91
            </xsd:complexType>
92
          </xsd:element>
93
          <xsd:element name="resheader">
94
            <xsd:complexType>
95
              <xsd:sequence>
96
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97
              </xsd:sequence>
98
              <xsd:attribute name="name" type="xsd:string" use="required" />
99
            </xsd:complexType>
100
          </xsd:element>
101
        </xsd:choice>
102
      </xsd:complexType>
103
    </xsd:element>
104
  </xsd:schema>
105
  <resheader name="resmimetype">
106
    <value>text/microsoft-resx</value>
107
  </resheader>
108
  <resheader name="version">
109
    <value>2.0</value>
110
  </resheader>
111
  <resheader name="reader">
112
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113
  </resheader>
114
  <resheader name="writer">
115
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
  </resheader>
117 117
</root>

+ 26 - 26
MandelbrotCalc/Properties/Settings.Designer.cs

@ -1,26 +1,26 @@
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     This code was generated by a tool.
4
//     Runtime Version:4.0.30319.42000
5
//
6
//     Changes to this file may cause incorrect behavior and will be lost if
7
//     the code is regenerated.
8
// </auto-generated>
9
//------------------------------------------------------------------------------
10
11
namespace MandelBrotCalc.Properties {
12
    
13
    
14
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17
        
18
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19
        
20
        public static Settings Default {
21
            get {
22
                return defaultInstance;
23
            }
24
        }
25
    }
26
}
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     This code was generated by a tool.
4
//     Runtime Version:4.0.30319.42000
5
//
6
//     Changes to this file may cause incorrect behavior and will be lost if
7
//     the code is regenerated.
8
// </auto-generated>
9
//------------------------------------------------------------------------------
10

11
namespace MandelBrotCalc.Properties {
12
    
13
    
14
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17
        
18
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19
        
20
        public static Settings Default {
21
            get {
22
                return defaultInstance;
23
            }
24
        }
25
    }
26
}

+ 7 - 7
MandelbrotCalc/Properties/Settings.settings

@ -1,7 +1,7 @@
1
<?xml version='1.0' encoding='utf-8'?>
2
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
  <Profiles>
4
    <Profile Name="(Default)" />
5
  </Profiles>
6
  <Settings />
7
</SettingsFile>
1
<?xml version='1.0' encoding='utf-8'?>
2
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
  <Profiles>
4
    <Profile Name="(Default)" />
5
  </Profiles>
6
  <Settings />
7
</SettingsFile>