Esempio n. 1
0
        private void bUpdate_Click(object sender, EventArgs e)
        {
            if (area == null || points == null)
            {
                MessageBox.Show("You must load an image and dataset before generating a heatmap.");
                return;
            }

            HeatMap m = new HeatMap(area, (float)numScaling.Value,
                (float)numDotradius.Value, (float)numOpacity.Value,
                cbGrayscale.Checked, cbTrimheatless.Checked);

            foreach (HeatMapPoint p in points)
            {
                m.AddPoint(p.X, p.Y);
            }

            bmp = m.GetBitmap();
            panelImage.Invalidate();
        }
Esempio n. 2
0
		private void bUpdate_Click(object sender, EventArgs e)
		{
			Stopwatch sw = new Stopwatch();
			sw.Start();

			if (area == null || points == null)
			{
				//MessageBox.Show("You must load an image and dataset before generating a heatmap.");
				//return;
				string ImgPath = "..\\..\\test.jpg";
				string DataPath = "..\\..\\hmIdsPerPoints.txt";
				LoadImage(ImgPath);
				DataLoad(DataPath);
				if (area == null || points == null)
				{
					MessageBox.Show("You must load an image and dataset before generating a heatmap.");
					return;
				}
			}

			HeatMap m = new HeatMap(area, (float)numScaling.Value,
				(float)numDotradius.Value, (float)numOpacity.Value,
				cbGrayscale.Checked, cbTrimheatless.Checked);

			foreach (HeatMapPoint p in points)
			{
				m.AddPoint(p.X, p.Y);
			}

			// zest. test.
			//for (int i = 0; i < area.Height; i++)
			//{
			//	for (int j = 0; j < area.Width; j++)
			//	{
			//		for (int k = 0; k < (1 + j + (10 * i)); k++)
			//		{
			//			m.AddPoint(j, i);
			//		}
			//	}
			//}

			bmp = m.GetBitmap();
			legend = m.GetLegend(150, bmp.Height, max, middle);
			sw.Stop();
			Debug.WriteLine(sw.ElapsedMilliseconds.ToString() + "ms");
			panelImage.Invalidate();
		}