private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex >= 0) { gv = new GraphVizRenderer(); pictureBox1.Image = gv.DrawGraphFromDotCode(comboBoxQuery[comboBox1.SelectedIndex].d.GraphVizFullCode()); gv.Dispose(); propertyGrid1.SelectedObject = comboBoxQuery[comboBox1.SelectedIndex].d; } }
void UpdateGraph() { if (comboBox1.SelectedIndex >= 0) { // Create the renderer gv = new GraphVizRenderer(); // Generate the graph based on the selected collection graphviz code pictureBox1.Image = gv.DrawGraphFromDotCode(DeMIMOI_Collection.Instances[comboBox1.SelectedIndex].GraphVizFullCode()); // Dispose the renderer gv.Dispose(); } }
private void button1_Click(object sender, EventArgs e) { // Create the GV object gv = new GraphVizRenderer(); // Free the previous image if there was one before if (pictureBox1.Image != null) { pictureBox1.Image.Dispose(); } // Draw the graph image using the given code and set it to the picturebox pictureBox1.Image = gv.DrawGraphFromDotCode("digraph{a -> b; b -> c; c -> a;}"); // Free the gv object gv.Dispose(); }