Beispiel #1
0
        private void chartIonogram_Paint(object sender, PaintEventArgs e)
        {
            if (listBoxIonograms.Items.Count > 0)
            {
                string ionname = Properties.Settings.Default.settingsWorkingDirectory + "\\";

                if (curIonogram == null)
                {
                    ionname     = Properties.Settings.Default.settingsWorkingDirectory + "\\" + this.listBoxIonograms.Items[0].ToString();
                    curIonogram = new IonogramReader(ionname);
                }

                ChartArea a  = chartIonogram.ChartAreas[0];
                int       x1 = (int)a.AxisX.ValueToPixelPosition(a.AxisX.Minimum) + a.AxisX.MajorGrid.LineWidth;
                int       x2 = (int)a.AxisX.ValueToPixelPosition(a.AxisX.Maximum) + 2 * a.AxisX.MajorGrid.LineWidth;
                int       y1 = (int)a.AxisY.ValueToPixelPosition(a.AxisY.Maximum) + a.AxisY.MajorGrid.LineWidth;
                int       y2 = (int)a.AxisY.ValueToPixelPosition(a.AxisY.Minimum) + 2 * a.AxisY.MajorGrid.LineWidth;

                e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
                if (curIonogram.Bitmap_O != null)
                {
                    e.Graphics.DrawImage(curIonogram.Bitmap_O, new Rectangle(x1, y1, x2 - x1, y2 - y1));
                }
            }
        }
Beispiel #2
0
        private void listBoxIonograms_SelectedValueChanged(object sender, EventArgs e)
        {
            ListBox listbox = (ListBox)sender;
            string  ionname = Properties.Settings.Default.settingsWorkingDirectory + "\\" + listbox.SelectedItem.ToString();

            curIonogram = new IonogramReader(ionname);

            chartIonogram.Invalidate();

            chartIonogram.Titles["TitleTimeIonogram"].Text = curIonogram.TimeString;
            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisX.Minimum  = curIonogram.Header.freq_min / 1000.0;
            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisX.Maximum  = curIonogram.Header.freq_max / 1000.0;
            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisX.Interval = 1;

            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisY.Minimum = (int)(curIonogram.Header.height_min / 1000.0);
            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisY.Maximum = (int)(curIonogram.Header.height_min +
                                                                                curIonogram.Header.height_step * (curIonogram.Header.count_height - 1)) / 1000.0;
            chartIonogram.ChartAreas["ChartAreaIonogram"].AxisY.Interval = 100.0;
        }