BioCore  5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
Plot.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9using System.Windows.Forms;
10using ScottPlot;
11using AForge;
12namespace BioCore
13{
14 public partial class Plot : Form
15 {
16 public ScottPlot.Plot plot;
17 string file;
18 string name;
19 System.Drawing.Bitmap bitmap;
20 List<double[]> data = new List<double[]>();
21 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
22 public List<double[]> Data
23 {
24 get { return data; }
25 set { data = value; UpdateImage(); }
26 }
27 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
28 public System.Drawing.Bitmap Image
29 {
30 get { return bitmap; }
31 set { bitmap = value; }
32 }
33 public Plot()
34 {
35 InitializeComponent();
37 name = DateTime.Now.Ticks.ToString();
38 this.Show();
39 }
40 public Plot(double[] vals, string name)
41 {
42 InitializeComponent();
43 data.Add(vals);
45 this.name = name;
46 this.Show();
47 }
48
49 public void UpdateImage()
50 {
51 /*
52 plot = new ScottPlot.Plot();
53 foreach (double[] val in data)
54 {
55 Bar b = new Bar();
56 b.Value = val;
57
58 plot.Add.Bar(val);
59 }
60 file = plot.SaveFig(name + ".png");
61 */
62 this.Text = name;
63 bitmap = (System.Drawing.Bitmap)System.Drawing.Bitmap.FromFile(file);
64 pictureBox.Image = bitmap;
65 }
66
67 private void Plot_FormClosing(object sender, FormClosingEventArgs e)
68 {
69
70 }
71
72 private void Plot_ResizeEnd(object sender, EventArgs e)
73 {
75 }
76 }
77}
System.Drawing.Image Image
Definition ImageView.cs:15
void UpdateImage()
Definition Plot.cs:49
ScottPlot.Plot plot
Definition Plot.cs:16
Plot(double[] vals, string name)
Definition Plot.cs:40