private void toolStripButton1_Click(object sender, EventArgs e) { ClusterOutput output = new ClusterOutput(); output.hNode = hnode; ClusterVis wrCluster=new ClusterVis(output); DialogResult res=saveFileDialog1.ShowDialog(); if (res == DialogResult.OK && saveFileDialog1.FileName.Length > 0) { Resolution resForm = new Resolution(buffer.Width, buffer.Height); res=resForm.ShowDialog(); if (res == DialogResult.OK) { Bitmap bmp = new Bitmap(resForm.Width, resForm.Height); PrepareGraphNodes(bmp); DrawOnBuffer(bmp); SavePicture(saveFileDialog1.FileName, bmp); PrepareGraphNodes(buffer); } // this.SavePicture(saveFileDialog1.FileName); } }