Beispiel #1
0
        /*private void Picture2D_Click(object sender, EventArgs e)
        {
            InputModule.InputText.KeyValues PictureMap = InputModule.InputText.EnterValues();
            Dictionary<string, Dictionary<string, double>> q = InputModule.Input.RunInputModule(PathToFile, PictureMap);
            List < Tuple<int[], int[], int[], int[], int[]> > lv = SorterModule.Sorter.ToDrawer(q, PictureMap, 128, 128, 0, 255, 255, 0);
            string s = "mapsnkeys//map5.png";
            DrawMap.DrawMap.PaintMap(ref s,lv.First().Item3, lv.First().Item4, lv.First().Item5, lv.First().Item1, lv.First().Item2);

        }*/
        private void Picture2D_Click(object sender, EventArgs e)
        {
			//  try
			//формат ARGB
			if (int.TryParse(DialSet.Drob.Text, out x) && (DialSet.Gradient.Checked || DialSet.Palitra.Checked))
			{
				if (x > 0 && x <= 20)
				{
					InputModule.InputText.KeyValues PictureMap = InputModule.InputText.EnterValues();
					Dictionary<string, Dictionary<string, double>> q = InputModule.Input.RunInputModule(PathToFile, PictureMap);
					List<Tuple<int[], int[], int[], int[], int[], int[], int[]>> lv = SorterModule.Sorter.ToDrawer(q, PictureMap, DialSet.Gradient.Checked);
					var bitmap = DM.PaintMap(Properties.Resources.map5, lv.First().Item3, lv.First().Item4, lv.First().Item5, lv.First().Item6, lv.First().Item1, lv.First().Item2);
					MainPicture.Image = bitmap;
					label1.Text = InputModule.Input.nam;
					double[] a = SorterModule.Sorter.FormForLegend();
					Tuple<int[], int[], int[], int[]> ffl = SorterModule.Sorter.FormForLegendColors(DialSet.Gradient.Checked);
					bitmap = DM.PaintLegend(ffl.Item1, ffl.Item2, ffl.Item3, ffl.Item4, a);
					LegendPicture.Image = bitmap;
				}
			}
            /*catch (Exception exception)
            {
                MessageBox.Show("Не верные данные " + exception.Message);
            }*/

        }
Beispiel #2
0
        private void Picture3D_Click(object sender, EventArgs e)
        {
			if (int.TryParse(DialSet.Drob.Text, out x) && (DialSet.Gradient.Checked || DialSet.Palitra.Checked))
			{
				if (x > 0 && x <= 20)
				{
					var a = new Wpf3DTest.MainWindow();
					InputModule.InputText.KeyValues PictureMap = InputModule.InputText.EnterValues();
					Dictionary<string, Dictionary<string, double>> q = InputModule.Input.RunInputModule(PathToFile, PictureMap);
					List<Tuple<int[], int[], int[], int[], int[], int[], int[]>> lv = SorterModule.Sorter.ToDrawer(q, PictureMap, DialSet.Gradient.Checked);
					a.InitializeComponent();
					for (int i = 0; i < 85; i++)
					{
						a.r[i] = lv.First().Item4[i];
						a.g[i] = lv.First().Item5[i];
						a.b[i] = lv.First().Item6[i];
						a.up[i] = -lv.First().Item7[i] * 0.1;
					}
					a.BuildSolid(a.r, a.g, a.b, a.up);
					a.turn(a.mGeometry);
					a.RenderSize = new System.Windows.Size(947,471);
					a.Width = MainPicture.Width + 14;
					a.Height = MainPicture.Height + 7;
					a.Left = Location.X + MainPicture.Location.X;
					a.Top = Location.Y + MainPicture.Location.Y + 31;
					

					//Location.X + MainPicture.Location.X, Location.Y + MainPicture.Location.Y, Location.X + MainPicture.Location.X + MainPicture.Width, Location.Y + MainPicture.Location.Y + MainPicture.Height
					a.Visibility = System.Windows.Visibility.Visible;
					label1.Text = InputModule.Input.nam;
					double[] u = SorterModule.Sorter.FormForLegend();
					Tuple<int[], int[], int[], int[]> ffl = SorterModule.Sorter.FormForLegendColors(DialSet.Gradient.Checked);
					Bitmap bitmap = DM.PaintLegend(ffl.Item1, ffl.Item2, ffl.Item3, ffl.Item4, u);
					LegendPicture.Image = bitmap;
				}
			}
		}