├── README.md
├── HeatMap
├── HeatMap.v11.suo
├── TestHeatMap
│ ├── Resources
│ │ ├── i_rainbow.png
│ │ ├── i_thermal.png
│ │ └── i_redwhiteblue.png
│ ├── App.config
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── AssemblyInfo.cs
│ │ ├── Settings.Designer.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Program.cs
│ ├── PointDataReader.cs
│ ├── TestHeatMap.csproj
│ ├── Form1.cs
│ ├── Form1.resx
│ └── Form1.Designer.cs
├── HeatMap
│ ├── HeatPoint.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── HeatMapMaker.cs
│ ├── HeatMap.csproj
│ └── ColorUtil.cs
└── HeatMap.sln
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | HeatMap
2 | =======
--------------------------------------------------------------------------------
/HeatMap/HeatMap.v11.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hmfly/HeatMap/HEAD/HeatMap/HeatMap.v11.suo
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Resources/i_rainbow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hmfly/HeatMap/HEAD/HeatMap/TestHeatMap/Resources/i_rainbow.png
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Resources/i_thermal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hmfly/HeatMap/HEAD/HeatMap/TestHeatMap/Resources/i_thermal.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | bin
3 | obj
4 |
5 | # mstest test results
6 | TestResults
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Resources/i_redwhiteblue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hmfly/HeatMap/HEAD/HeatMap/TestHeatMap/Resources/i_redwhiteblue.png
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/HeatMap/HeatMap/HeatPoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace HeatMap
8 | {
9 | public class HeatPoint
10 | {
11 | public float X;
12 | public float Y;
13 | public float W;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Program.cs:
--------------------------------------------------------------------------------
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 TestHeatMap
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/PointDataReader.cs:
--------------------------------------------------------------------------------
1 | using HeatMap;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace TestHeatMap
10 | {
11 | static class PointDataReader
12 | {
13 | public static List Read(string filePath)
14 | {
15 | var result = new List();
16 |
17 | using (var sr = new StreamReader(filePath))
18 | {
19 | while (!sr.EndOfStream)
20 | {
21 | var vals = sr.ReadLine().Split(',');
22 | var point = new HeatPoint();
23 | point.X = float.Parse(vals[0]);
24 | point.Y = float.Parse(vals[1]);
25 | point.W = float.Parse(vals[2]);
26 |
27 | result.Add(point);
28 | }
29 | }
30 |
31 | return result;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/HeatMap/HeatMap/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("HeatMap")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("HeatMap")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("061fbba7-862a-4171-86f4-b992e4101b9f")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("TestHeatMap")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TestHeatMap")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("6ad048be-9710-4dd4-a347-aa9f6bd0252e")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17626
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestHeatMap.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/HeatMap/HeatMap.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeatMap", "HeatMap\HeatMap.csproj", "{AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHeatMap", "TestHeatMap\TestHeatMap.csproj", "{F491DB23-1B09-402B-817B-D71A98941EEA}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | {F491DB23-1B09-402B-817B-D71A98941EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {F491DB23-1B09-402B-817B-D71A98941EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {F491DB23-1B09-402B-817B-D71A98941EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {F491DB23-1B09-402B-817B-D71A98941EEA}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/HeatMap/HeatMap/HeatMapMaker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Drawing;
7 | using System.Drawing.Drawing2D;
8 | using System.Drawing.Imaging;
9 | using System.Diagnostics;
10 |
11 | namespace HeatMap
12 | {
13 | public class HeatMapMaker
14 | {
15 | public int Width { get; set; }
16 | public int Height { get; set; }
17 | public int Radius { get; set; }
18 | public float Opacity { get; set; }
19 | public ColorRamp ColorRamp { get; set; }
20 | public List HeatPoints { get; set; }
21 | public Bitmap GrayMap { get; private set; }
22 |
23 | public Task MakeHeatMap()
24 | {
25 | return Task.Run(() =>
26 | {
27 | var result = new Bitmap(this.Width, this.Height, PixelFormat.Format32bppArgb);
28 |
29 | this.GrayMap = this.makeGrayMap().Result; //*****
30 |
31 | for (int x = 0; x < this.Width; x++)
32 | {
33 | for (int y = 0; y < this.Height; y++)
34 | {
35 | var grayVal = this.GrayMap.GetPixel(x, y);
36 | var index = grayVal.A;
37 | var color = ColorUtil.GetColorInRamp(index, this.ColorRamp);
38 | result.SetPixel(x, y, color);
39 | }
40 | }
41 |
42 | return ColorUtil.AdjustOpacity(result, this.Opacity);
43 | });
44 | }
45 |
46 | private Task makeGrayMap()
47 | {
48 | return Task.Run(() =>
49 | {
50 | var result = new Bitmap(this.Width, this.Height, PixelFormat.Format32bppArgb);
51 | var graphics = Graphics.FromImage(result);
52 |
53 | var grayRamp = ColorUtil.GetGrayRamp();
54 | foreach (var point in this.HeatPoints)
55 | {
56 | var r = this.Radius;
57 | var rect = new Rectangle((int)point.X - (int)r, (int)point.Y - (int)r, (int)r * 2, (int)r * 2);
58 |
59 | var path = new GraphicsPath();
60 | path.AddEllipse(rect);
61 | var brush = new PathGradientBrush(path);
62 |
63 | brush.InterpolationColors = grayRamp;
64 | graphics.FillEllipse(brush, rect);
65 | }
66 | graphics.Dispose();
67 |
68 | return result;
69 | });
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/HeatMap/HeatMap/HeatMap.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {AFF6F8A5-D562-4AB0-B32A-A6919E98C12E}
8 | Library
9 | Properties
10 | HeatMap
11 | HeatMap
12 | v4.5
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.17929
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestHeatMap.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
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 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
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("TestHeatMap.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
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 | ///
64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap i_rainbow {
67 | get {
68 | object obj = ResourceManager.GetObject("i_rainbow", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
75 | ///
76 | internal static System.Drawing.Bitmap i_redwhiteblue {
77 | get {
78 | object obj = ResourceManager.GetObject("i_redwhiteblue", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
85 | ///
86 | internal static System.Drawing.Bitmap i_thermal {
87 | get {
88 | object obj = ResourceManager.GetObject("i_thermal", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/TestHeatMap.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F491DB23-1B09-402B-817B-D71A98941EEA}
8 | WinExe
9 | Properties
10 | TestHeatMap
11 | TestHeatMap
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | Form1.cs
52 |
53 |
54 |
55 |
56 |
57 | Form1.cs
58 |
59 |
60 | ResXFileCodeGenerator
61 | Resources.Designer.cs
62 | Designer
63 |
64 |
65 | True
66 | Resources.resx
67 | True
68 |
69 |
70 | SettingsSingleFileGenerator
71 | Settings.Designer.cs
72 |
73 |
74 | True
75 | Settings.settings
76 | True
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {aff6f8a5-d562-4ab0-b32a-a6919e98c12e}
85 | HeatMap
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
105 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Form1.cs:
--------------------------------------------------------------------------------
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 |
11 | using HeatMap;
12 | using TestHeatMap.Properties;
13 |
14 | namespace TestHeatMap
15 | {
16 | public partial class Form1 : Form
17 | {
18 | int _width;
19 | int _height;
20 | int _count;
21 | float _opacity;
22 | int _radius;
23 | ColorRamp _colorRamp;
24 | List _points;
25 |
26 | public Form1()
27 | {
28 | InitializeComponent();
29 | }
30 |
31 | List randomPoints(int width, int height, int count)
32 | {
33 | var result = new List();
34 |
35 | var r = new Random();
36 | for (int i = 0; i < count; i++)
37 | {
38 | var x = r.Next(width);
39 | var y = r.Next(height);
40 | //var w = (float)r.NextDouble()/2;
41 |
42 | var point = new HeatPoint
43 | {
44 | X = x,
45 | Y = y,
46 | W = 1
47 | };
48 |
49 | result.Add(point);
50 | }
51 |
52 | return result;
53 | }
54 |
55 | private async void make4Maps(int width, int height, int radius, List points, float opacity, ColorRamp cr)
56 | {
57 | var hmMaker = new HeatMapMaker
58 | {
59 | Width = width,
60 | Height = height,
61 | Radius = radius,
62 | ColorRamp = cr,
63 | HeatPoints = points,
64 | Opacity = opacity
65 | };
66 | this.pictureBox2.BackgroundImage = await hmMaker.MakeHeatMap();
67 |
68 | //
69 | this.pictureBox1.BackgroundImage = hmMaker.GrayMap;
70 |
71 | //
72 | displayInfo();
73 | }
74 |
75 | private void displayInfo()
76 | {
77 | this.lblCount.Text = String.Format("{0}:{1}", "Point Count", _count);
78 | this.lblRadius.Text = String.Format("{0}:{1}", "Point Radius", _radius);
79 | this.lblOpacity.Text = String.Format("{0}:{1}", "Map Opacity", _opacity);
80 | }
81 |
82 | private void tbHPCount_Scroll(object sender, EventArgs e)
83 | {
84 | _count = this.tbHPCount.Value;
85 | _points = randomPoints(_width, _height, _count);
86 | make4Maps(_width, _height, _radius, _points, _opacity, _colorRamp);
87 | }
88 |
89 | private void tbHPRadius_Scroll(object sender, EventArgs e)
90 | {
91 | _radius = this.tbHPRadius.Value;
92 | make4Maps(_width, _height, _radius, _points, _opacity, _colorRamp);
93 | }
94 |
95 | private void tbOpacity_Scroll(object sender, EventArgs e)
96 | {
97 | _opacity = this.tbOpacity.Value/10f;
98 | make4Maps(_width, _height, _radius, _points, _opacity, _colorRamp);
99 | }
100 |
101 | private void cmbColorRamp_SelectedIndexChanged(object sender, EventArgs e)
102 | {
103 | switch (this.cmbColorRamp.SelectedIndex)
104 | {
105 | case 0:
106 | this.pictureBox3.BackgroundImage = Resources.i_thermal;
107 | break;
108 | case 1:
109 | this.pictureBox3.BackgroundImage = Resources.i_rainbow;
110 | break;
111 | case 2:
112 | this.pictureBox3.BackgroundImage = Resources.i_redwhiteblue;
113 | break;
114 | }
115 |
116 | _colorRamp = (ColorRamp)Enum.Parse(typeof(ColorRamp), this.cmbColorRamp.SelectedItem.ToString());
117 |
118 | make4Maps(_width, _height, _radius, _points, _opacity, _colorRamp);
119 | }
120 |
121 | private void Form1_Load(object sender, EventArgs e)
122 | {
123 | _width = this.pictureBox1.Width;
124 | _height = this.pictureBox1.Height;
125 | _opacity = this.tbOpacity.Value / 10f;
126 | _count = this.tbHPCount.Value;
127 | _radius = this.tbHPRadius.Value;
128 | _points = randomPoints(_width, _height, _count);
129 | this.cmbColorRamp.SelectedIndex = 1;
130 | _colorRamp = (ColorRamp)Enum.Parse(typeof(ColorRamp), this.cmbColorRamp.SelectedItem.ToString());
131 | make4Maps(_width, _height, _radius, _points, _opacity, _colorRamp);
132 | }
133 |
134 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
135 | {
136 | System.Diagnostics.Process.Start("http://goo.gl/fwM4Y");
137 | }
138 | }
139 | }
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\i_rainbow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\i_redwhiteblue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\i_thermal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
--------------------------------------------------------------------------------
/HeatMap/HeatMap/ColorUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Drawing.Drawing2D;
5 | using System.Drawing.Imaging;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace HeatMap
11 | {
12 | public enum ColorRamp
13 | {
14 | THERMAL,
15 | RAINBOW,
16 | RED_WHITE_BLUE,
17 | }
18 |
19 | public static class ColorUtil
20 | {
21 | private static readonly uint[] uTHERMAL = new uint[256] { 0, 167772262, 336396403, 504430711, 672727155, 857605496, 1025311865, 1193542778, 1361445755, 1529480062, 1714226559, 1882326399, 2050229378, 2218264197, 2386232710, 2571044231, 2739013001, 2906982028, 3075081868, 3243050383, 3427796369, 3595765395, 3763734164, 3931768213, 4099736983, 4284614554, 4284745369, 4284876441, 4285007513, 4285138585, 4285334937, 4285466009, 4285597081, 4285728153, 4285924505, 4286055577, 4286186649, 4286317721, 4286514073, 4286645145, 4286776217, 4286907289, 4287103641, 4287234713, 4287365785, 4287496857, 4287693209, 4287824281, 4287955353, 4288086425, 4288283033, 4288348568, 4288414103, 4288545431, 4288610966, 4288742293, 4288807829, 4288938900, 4289004691, 4289135763, 4289201554, 4289332625, 4289398161, 4289529488, 4289595024, 4289726351, 4289791886, 4289922958, 4289988749, 4290119820, 4290185612, 4290316683, 4290382218, 4290513546, 4290579081, 4290710409, 4290776198, 4290841987, 4290907777, 4290973822, 4291039612, 4291105401, 4291171447, 4291237236, 4291303026, 4291369071, 4291434861, 4291500650, 4291566696, 4291632485, 4291698275, 4291764320, 4291830110, 4291895899, 4291961945, 4292027734, 4292093524, 4292159569, 4292225359, 4292291148, 4292422730, 4292422983, 4292489029, 4292489282, 4292555328, 4292621118, 4292621627, 4292687417, 4292753462, 4292753972, 4292819762, 4292885807, 4292886061, 4292952106, 4292952360, 4293018406, 4293084195, 4293084705, 4293150750, 4293216540, 4293217050, 4293282839, 4293348885, 4293349138, 4293415184, 4293481230, 4293481485, 4293481996, 4293547788, 4293548299, 4293614091, 4293614602, 4293614858, 4293680905, 4293681416, 4293747208, 4293747719, 4293747975, 4293814022, 4293814278, 4293880325, 4293880581, 4293881092, 4293947139, 4293947395, 4294013442, 4294013698, 4294014209, 4294080001, 4294080512, 4294146560, 4294146816, 4294147328, 4294213376, 4294213632, 4294214144, 4294280192, 4294280704, 4294280960, 4294347008, 4294347520, 4294347776, 4294413824, 4294414336, 4294480384, 4294480640, 4294481152, 4294547200, 4294547456, 4294547968, 4294614016, 4294614528, 4294614784, 4294680832, 4294681344, 4294747392, 4294747648, 4294747904, 4294748416, 4294748672, 4294749184, 4294749440, 4294749952, 4294750208, 4294750464, 4294750976, 4294751232, 4294751744, 4294752000, 4294752512, 4294752768, 4294753280, 4294753536, 4294753792, 4294754304, 4294754560, 4294755072, 4294755328, 4294755840, 4294756096, 4294756608, 4294756869, 4294757130, 4294757391, 4294757652, 4294757913, 4294758174, 4294758435, 4294758696, 4294758957, 4294759219, 4294759480, 4294759741, 4294760258, 4294760519, 4294760780, 4294761041, 4294826838, 4294827099, 4294827360, 4294827622, 4294827883, 4294828144, 4294828405, 4294828666, 4294829183, 4294829444, 4294829705, 4294829966, 4294830227, 4294830489, 4294830750, 4294831011, 4294831272, 4294897069, 4294897330, 4294897591, 4294897852, 4294898369, 4294898630, 4294898892, 4294899153, 4294899414, 4294899675, 4294899936, 4294900197, 4294900458, 4294900719, 4294900980, 4294901241, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295 };
22 | private static readonly uint[] uRAINBOW = new uint[256] { 0, 167772415, 335544575, 503316726, 671088889, 855638261, 1023410423, 1191182584, 1358954741, 1526726902, 1711276277, 1879048438, 2046820599, 2214592757, 2382364918, 2566914293, 2734686453, 2902458614, 3070230773, 3238002934, 3422552309, 3590324469, 3758096630, 3925868788, 4093640949, 4278190326, 4278191862, 4278193398, 4278195190, 4278196726, 4278198518, 4278200054, 4278201590, 4278203382, 4278204918, 4278206710, 4278208246, 4278209782, 4278211574, 4278213110, 4278214902, 4278216438, 4278217974, 4278219766, 4278221302, 4278223094, 4278224630, 4278226166, 4278227958, 4278229494, 4278296822, 4278232053, 4278232821, 4278233588, 4278234356, 4278235124, 4278235891, 4278236659, 4278237426, 4278238194, 4278238962, 4278239729, 4278240497, 4278241264, 4278242032, 4278242800, 4278243567, 4278244335, 4278245102, 4278245870, 4278246638, 4278247405, 4278248173, 4278248940, 4278249708, 4278250732, 4278250722, 4278250969, 4278251215, 4278251462, 4278251452, 4278251699, 4278251945, 4278252192, 4278252183, 4278252429, 4278252676, 4278252922, 4278252913, 4278253159, 4278253406, 4278253652, 4278253643, 4278253890, 4278254136, 4278254383, 4278254373, 4278254620, 4278254866, 4278255113, 4278255360, 4278910720, 4279566080, 4280221440, 4280876800, 4281597696, 4282253056, 4282908416, 4283563776, 4284219136, 4284940032, 4285595392, 4286250752, 4286906112, 4287561472, 4288282368, 4288937728, 4289593088, 4290248448, 4290903808, 4291624704, 4292280064, 4292935424, 4293590784, 4294246144, 4294967040, 4294900736, 4294834432, 4294768384, 4294702080, 4294636032, 4294569728, 4294503680, 4294437376, 4294371328, 4294305024, 4294238976, 4294172672, 4294106624, 4294040320, 4293974272, 4293907968, 4293841920, 4293775616, 4293709568, 4293643264, 4293577216, 4293510912, 4293444864, 4293378560, 4293378048, 4293377536, 4293442560, 4293507584, 4293572608, 4293637632, 4293702656, 4293767680, 4293832704, 4293897728, 4293962752, 4294027776, 4294092800, 4294158080, 4294223104, 4294288128, 4294353152, 4294418176, 4294483200, 4294548224, 4294613248, 4294678272, 4294743296, 4294808320, 4294873344, 4294938624, 4294937088, 4294935552, 4294934016, 4294932480, 4294931200, 4294929664, 4294928128, 4294926592, 4294925312, 4294923776, 4294922240, 4294920704, 4294919424, 4294917888, 4294916352, 4294914816, 4294913536, 4294912000, 4294910464, 4294908928, 4294907648, 4294906112, 4294904576, 4294903040, 4294901760, 4294903045, 4294904330, 4294905615, 4294906900, 4294908185, 4294909470, 4294910755, 4294912040, 4294913325, 4294914867, 4294916152, 4294917437, 4294918722, 4294920007, 4294921292, 4294922577, 4294923862, 4294925147, 4294926432, 4294927974, 4294929259, 4294930544, 4294931829, 4294933114, 4294934399, 4294935684, 4294936969, 4294938254, 4294939539, 4294941081, 4294942366, 4294943651, 4294944936, 4294946221, 4294947506, 4294948791, 4294950076, 4294951361, 4294952646, 4294954188, 4294955473, 4294956758, 4294958043, 4294959328, 4294960613, 4294961898, 4294963183, 4294964468, 4294965753, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295 };
23 | private static readonly uint[] uRED_WHITE_BLUE = new uint[256] { 0, 50331903, 100663551, 167772415, 218104063, 285212927, 335544575, 385876223, 452985077, 503316726, 570425591, 620757240, 671088889, 738197753, 788529401, 855638266, 905969914, 956301562, 1023410427, 1073742071, 1140850935, 1191182584, 1241514232, 1308623096, 1358954744, 1426063609, 1476395257, 1526726905, 1593835770, 1644167418, 1711276282, 1761607930, 1811939578, 1879048440, 1929380090, 1996488954, 2046820603, 2097152251, 2164261113, 2214592761, 2281701625, 2332033273, 2382364923, 2449473787, 2499805436, 2566914298, 2617245946, 2667577594, 2734686458, 2785018106, 2852126972, 2902458620, 2952790267, 3019899132, 3070230780, 3137339644, 3187671292, 3238002939, 3305111803, 3355443452, 3422552316, 3472883964, 3523215612, 3590324477, 3640656124, 3707764988, 3758096636, 3808428285, 3875537149, 3925868797, 3992977662, 4043309309, 4093640957, 4160749822, 4211081470, 4278190335, 4278386939, 4278583544, 4278845684, 4279042289, 4279304430, 4279501034, 4279697639, 4279959779, 4280156384, 4280418525, 4280615129, 4280811734, 4281073874, 4281270479, 4281532620, 4281729224, 4281925829, 4282187969, 4282384574, 4282646715, 4282843319, 4283039924, 4283302064, 4283498669, 4283760810, 4283957414, 4284154019, 4284416159, 4284612764, 4284874905, 4285071509, 4285268114, 4285530254, 4285726859, 4285989000, 4286185604, 4286382209, 4286644349, 4286840954, 4287103095, 4287299699, 4287496304, 4287758444, 4287955049, 4288217190, 4288413794, 4288610399, 4288872539, 4289069144, 4289331285, 4289527889, 4289724494, 4289986634, 4290183239, 4290445380, 4290641984, 4290838589, 4291100729, 4291297334, 4291559475, 4291756079, 4291952684, 4292214824, 4292411429, 4292673570, 4292870174, 4293066779, 4293328919, 4293525524, 4293787665, 4293984269, 4294180874, 4294443014, 4294639619, 4294901760, 4294902531, 4294903302, 4294904330, 4294905101, 4294906129, 4294906900, 4294907671, 4294908699, 4294909470, 4294910498, 4294911269, 4294912040, 4294913068, 4294913839, 4294914867, 4294915638, 4294916409, 4294917437, 4294918208, 4294919236, 4294920007, 4294920778, 4294921806, 4294922577, 4294923605, 4294924376, 4294925147, 4294926175, 4294926946, 4294927974, 4294928745, 4294929516, 4294930544, 4294931315, 4294932343, 4294933114, 4294933885, 4294934913, 4294935684, 4294936712, 4294937483, 4294938254, 4294939282, 4294940053, 4294941081, 4294941852, 4294942623, 4294943651, 4294944422, 4294945450, 4294946221, 4294946992, 4294948020, 4294948791, 4294949819, 4294950590, 4294951361, 4294952389, 4294953160, 4294954188, 4294954959, 4294955730, 4294956758, 4294957529, 4294958557, 4294959328, 4294960099, 4294961127, 4294961898, 4294962926, 4294963697, 4294964468, 4294965496, 4294966267, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295 };
24 |
25 | private static readonly int[] THERMAL = null;
26 | private static readonly int[] RAINBOW = null;
27 | private static readonly int[] RED_WHITE_BLUE = null;
28 |
29 | static ColorUtil()
30 | {
31 | THERMAL = convertColorRamp(uTHERMAL);
32 | RAINBOW = convertColorRamp(uRAINBOW);
33 | RED_WHITE_BLUE = convertColorRamp(uRED_WHITE_BLUE);
34 | }
35 |
36 | public static Bitmap AdjustOpacity(Bitmap map, float opacity)
37 | {
38 | var result = new Bitmap(map.Width, map.Height, PixelFormat.Format32bppArgb);
39 | var graphics = Graphics.FromImage(result);
40 |
41 | var imageAttributes = new ImageAttributes();
42 | float[][] colorMatrixElements = {
43 | new float[] {1, 0, 0, 0, 0},
44 | new float[] {0, 1, 0, 0, 0},
45 | new float[] {0, 0, 1, 0, 0},
46 | new float[] {0, 0, 0, opacity, 0},
47 | new float[] {0, 0, 0, 0, 1}};
48 | ColorMatrix colorMatrix = new ColorMatrix(colorMatrixElements);
49 | imageAttributes.SetColorMatrix(
50 | colorMatrix,
51 | ColorMatrixFlag.Default,
52 | ColorAdjustType.Bitmap);
53 |
54 | graphics.DrawImage(
55 | map,
56 | new Rectangle(0, 0, map.Width, map.Height),
57 | 0, 0,
58 | map.Width,
59 | map.Height,
60 | GraphicsUnit.Pixel,
61 | imageAttributes);
62 | graphics.Dispose();
63 |
64 | return result;
65 | }
66 |
67 | public static ColorBlend GetGrayRamp(float intensity, int maxGrayVal = 50)
68 | {
69 | var result = new ColorBlend();
70 |
71 | result.Positions = new float[2] { 0f, 1f };
72 |
73 | var grayVal = (int)(255 * intensity);
74 | var colors = new Color[2];
75 | colors[0] = Color.FromArgb(0, Color.Black);
76 | colors[1] =
77 | grayVal > maxGrayVal
78 | ? Color.FromArgb(maxGrayVal, Color.Black)
79 | : Color.FromArgb(grayVal, Color.Black);
80 | result.Colors = colors;
81 |
82 | return result;
83 | }
84 |
85 | public static ColorBlend GetGrayRamp()
86 | {
87 | var result = new ColorBlend();
88 |
89 | result.Positions = new float[2] { 0f, 1f };
90 |
91 | var colors = new Color[2];
92 | colors[0] = Color.FromArgb(0, Color.Black);
93 | colors[1] = Color.FromArgb(50, Color.Black);
94 | result.Colors = colors;
95 |
96 | return result;
97 | }
98 |
99 | public static Color GetColorInRamp(int index, ColorRamp cr)
100 | {
101 | switch (cr)
102 | {
103 | case ColorRamp.RAINBOW:
104 | return Color.FromArgb(RAINBOW[index]);
105 | case ColorRamp.RED_WHITE_BLUE:
106 | return Color.FromArgb(RED_WHITE_BLUE[index]);
107 | case ColorRamp.THERMAL:
108 | return Color.FromArgb(THERMAL[index]);
109 | default:
110 | return Color.White;
111 | }
112 | }
113 |
114 | private static int[] convertColorRamp(uint[] srcRamp)
115 | {
116 | var result = new List();
117 | foreach (var color in srcRamp)
118 | {
119 | result.Add((int)color);
120 | }
121 | return result.ToArray();
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/HeatMap/TestHeatMap/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace TestHeatMap
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
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 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.panel1 = new System.Windows.Forms.Panel();
32 | this.lblOpacity = new System.Windows.Forms.Label();
33 | this.lblRadius = new System.Windows.Forms.Label();
34 | this.lblCount = new System.Windows.Forms.Label();
35 | this.tbOpacity = new System.Windows.Forms.TrackBar();
36 | this.tbHPRadius = new System.Windows.Forms.TrackBar();
37 | this.tbHPCount = new System.Windows.Forms.TrackBar();
38 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
39 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
40 | this.pictureBox2 = new System.Windows.Forms.PictureBox();
41 | this.cmbColorRamp = new System.Windows.Forms.ComboBox();
42 | this.linkLabel1 = new System.Windows.Forms.LinkLabel();
43 | this.pictureBox3 = new System.Windows.Forms.PictureBox();
44 | this.panel1.SuspendLayout();
45 | ((System.ComponentModel.ISupportInitialize)(this.tbOpacity)).BeginInit();
46 | ((System.ComponentModel.ISupportInitialize)(this.tbHPRadius)).BeginInit();
47 | ((System.ComponentModel.ISupportInitialize)(this.tbHPCount)).BeginInit();
48 | this.tableLayoutPanel1.SuspendLayout();
49 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
50 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
51 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
52 | this.SuspendLayout();
53 | //
54 | // panel1
55 | //
56 | this.panel1.AutoSize = true;
57 | this.panel1.BackColor = System.Drawing.SystemColors.Control;
58 | this.panel1.Controls.Add(this.pictureBox3);
59 | this.panel1.Controls.Add(this.linkLabel1);
60 | this.panel1.Controls.Add(this.cmbColorRamp);
61 | this.panel1.Controls.Add(this.lblOpacity);
62 | this.panel1.Controls.Add(this.lblRadius);
63 | this.panel1.Controls.Add(this.lblCount);
64 | this.panel1.Controls.Add(this.tbOpacity);
65 | this.panel1.Controls.Add(this.tbHPRadius);
66 | this.panel1.Controls.Add(this.tbHPCount);
67 | this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
68 | this.panel1.Location = new System.Drawing.Point(0, 662);
69 | this.panel1.MaximumSize = new System.Drawing.Size(1200, 80);
70 | this.panel1.MinimumSize = new System.Drawing.Size(1200, 80);
71 | this.panel1.Name = "panel1";
72 | this.panel1.Size = new System.Drawing.Size(1200, 80);
73 | this.panel1.TabIndex = 0;
74 | //
75 | // lblOpacity
76 | //
77 | this.lblOpacity.AutoSize = true;
78 | this.lblOpacity.Location = new System.Drawing.Point(887, 56);
79 | this.lblOpacity.Name = "lblOpacity";
80 | this.lblOpacity.Size = new System.Drawing.Size(41, 12);
81 | this.lblOpacity.TabIndex = 6;
82 | this.lblOpacity.Text = "label3";
83 | //
84 | // lblRadius
85 | //
86 | this.lblRadius.AutoSize = true;
87 | this.lblRadius.Location = new System.Drawing.Point(781, 56);
88 | this.lblRadius.Name = "lblRadius";
89 | this.lblRadius.Size = new System.Drawing.Size(41, 12);
90 | this.lblRadius.TabIndex = 5;
91 | this.lblRadius.Text = "label2";
92 | //
93 | // lblCount
94 | //
95 | this.lblCount.AutoSize = true;
96 | this.lblCount.Location = new System.Drawing.Point(375, 59);
97 | this.lblCount.Name = "lblCount";
98 | this.lblCount.Size = new System.Drawing.Size(41, 12);
99 | this.lblCount.TabIndex = 4;
100 | this.lblCount.Text = "label1";
101 | //
102 | // tbOpacity
103 | //
104 | this.tbOpacity.LargeChange = 1;
105 | this.tbOpacity.Location = new System.Drawing.Point(878, 8);
106 | this.tbOpacity.Name = "tbOpacity";
107 | this.tbOpacity.Size = new System.Drawing.Size(100, 45);
108 | this.tbOpacity.TabIndex = 2;
109 | this.tbOpacity.Value = 10;
110 | this.tbOpacity.Scroll += new System.EventHandler(this.tbOpacity_Scroll);
111 | //
112 | // tbHPRadius
113 | //
114 | this.tbHPRadius.Location = new System.Drawing.Point(772, 8);
115 | this.tbHPRadius.Maximum = 50;
116 | this.tbHPRadius.Minimum = 5;
117 | this.tbHPRadius.Name = "tbHPRadius";
118 | this.tbHPRadius.Size = new System.Drawing.Size(100, 45);
119 | this.tbHPRadius.TabIndex = 1;
120 | this.tbHPRadius.TickFrequency = 5;
121 | this.tbHPRadius.Value = 25;
122 | this.tbHPRadius.Scroll += new System.EventHandler(this.tbHPRadius_Scroll);
123 | //
124 | // tbHPCount
125 | //
126 | this.tbHPCount.LargeChange = 100;
127 | this.tbHPCount.Location = new System.Drawing.Point(12, 8);
128 | this.tbHPCount.Maximum = 2000;
129 | this.tbHPCount.Minimum = 1;
130 | this.tbHPCount.Name = "tbHPCount";
131 | this.tbHPCount.Size = new System.Drawing.Size(754, 45);
132 | this.tbHPCount.SmallChange = 10;
133 | this.tbHPCount.TabIndex = 0;
134 | this.tbHPCount.TickFrequency = 100;
135 | this.tbHPCount.Value = 111;
136 | this.tbHPCount.Scroll += new System.EventHandler(this.tbHPCount_Scroll);
137 | //
138 | // tableLayoutPanel1
139 | //
140 | this.tableLayoutPanel1.ColumnCount = 2;
141 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
142 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
143 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
144 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
145 | this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 0, 0);
146 | this.tableLayoutPanel1.Controls.Add(this.pictureBox2, 1, 0);
147 | this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
148 | this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
149 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
150 | this.tableLayoutPanel1.RowCount = 1;
151 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
152 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
153 | this.tableLayoutPanel1.Size = new System.Drawing.Size(1184, 662);
154 | this.tableLayoutPanel1.TabIndex = 1;
155 | //
156 | // pictureBox1
157 | //
158 | this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
159 | this.pictureBox1.Location = new System.Drawing.Point(3, 3);
160 | this.pictureBox1.Name = "pictureBox1";
161 | this.pictureBox1.Size = new System.Drawing.Size(586, 656);
162 | this.pictureBox1.TabIndex = 0;
163 | this.pictureBox1.TabStop = false;
164 | //
165 | // pictureBox2
166 | //
167 | this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;
168 | this.pictureBox2.Location = new System.Drawing.Point(595, 3);
169 | this.pictureBox2.Name = "pictureBox2";
170 | this.pictureBox2.Size = new System.Drawing.Size(586, 656);
171 | this.pictureBox2.TabIndex = 1;
172 | this.pictureBox2.TabStop = false;
173 | //
174 | // cmbColorRamp
175 | //
176 | this.cmbColorRamp.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
177 | this.cmbColorRamp.FormattingEnabled = true;
178 | this.cmbColorRamp.Items.AddRange(new object[] {
179 | "THERMAL",
180 | "RAINBOW",
181 | "RED_WHITE_BLUE"});
182 | this.cmbColorRamp.Location = new System.Drawing.Point(1042, 22);
183 | this.cmbColorRamp.Name = "cmbColorRamp";
184 | this.cmbColorRamp.Size = new System.Drawing.Size(121, 20);
185 | this.cmbColorRamp.TabIndex = 7;
186 | this.cmbColorRamp.SelectedIndexChanged += new System.EventHandler(this.cmbColorRamp_SelectedIndexChanged);
187 | //
188 | // linkLabel1
189 | //
190 | this.linkLabel1.AutoSize = true;
191 | this.linkLabel1.Location = new System.Drawing.Point(1050, 45);
192 | this.linkLabel1.Name = "linkLabel1";
193 | this.linkLabel1.Size = new System.Drawing.Size(107, 12);
194 | this.linkLabel1.TabIndex = 2;
195 | this.linkLabel1.TabStop = true;
196 | this.linkLabel1.Text = "http://hmfly.info";
197 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
198 | //
199 | // pictureBox3
200 | //
201 | this.pictureBox3.Location = new System.Drawing.Point(994, 22);
202 | this.pictureBox3.Name = "pictureBox3";
203 | this.pictureBox3.Size = new System.Drawing.Size(40, 40);
204 | this.pictureBox3.TabIndex = 8;
205 | this.pictureBox3.TabStop = false;
206 | //
207 | // Form1
208 | //
209 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
210 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
211 | this.ClientSize = new System.Drawing.Size(1184, 742);
212 | this.Controls.Add(this.tableLayoutPanel1);
213 | this.Controls.Add(this.panel1);
214 | this.MaximizeBox = false;
215 | this.MaximumSize = new System.Drawing.Size(1200, 781);
216 | this.MinimumSize = new System.Drawing.Size(1200, 781);
217 | this.Name = "Form1";
218 | this.ShowIcon = false;
219 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
220 | this.Text = "HeatMap";
221 | this.Load += new System.EventHandler(this.Form1_Load);
222 | this.panel1.ResumeLayout(false);
223 | this.panel1.PerformLayout();
224 | ((System.ComponentModel.ISupportInitialize)(this.tbOpacity)).EndInit();
225 | ((System.ComponentModel.ISupportInitialize)(this.tbHPRadius)).EndInit();
226 | ((System.ComponentModel.ISupportInitialize)(this.tbHPCount)).EndInit();
227 | this.tableLayoutPanel1.ResumeLayout(false);
228 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
229 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
230 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
231 | this.ResumeLayout(false);
232 | this.PerformLayout();
233 |
234 | }
235 |
236 | #endregion
237 |
238 | private System.Windows.Forms.Panel panel1;
239 | private System.Windows.Forms.TrackBar tbOpacity;
240 | private System.Windows.Forms.TrackBar tbHPRadius;
241 | private System.Windows.Forms.TrackBar tbHPCount;
242 | private System.Windows.Forms.Label lblOpacity;
243 | private System.Windows.Forms.Label lblRadius;
244 | private System.Windows.Forms.Label lblCount;
245 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
246 | private System.Windows.Forms.PictureBox pictureBox1;
247 | private System.Windows.Forms.PictureBox pictureBox2;
248 | private System.Windows.Forms.ComboBox cmbColorRamp;
249 | private System.Windows.Forms.LinkLabel linkLabel1;
250 | private System.Windows.Forms.PictureBox pictureBox3;
251 |
252 |
253 | }
254 | }
255 |
256 |
--------------------------------------------------------------------------------