0
私は次のようにしてチャートを保存します。フォームをイメージとしてファイルに保存するにはどうすればよいですか?私のプログラムで
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
chart.SaveImage(saveFileDialog.FileName, ChartImageFormat.Bmp);
}
しかし、どのように私は、チャートが配置されている全フォームを保存しますか?
更新:
私は解決策が見つかりました:すべてのコントロールで使用することができます
Control.DrawToBitmap
機能There`s
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
Bitmap bm = new Bitmap(this.Width, this.Height);
Rectangle rect = new Rectangle(0, 0, this.Width, this.Height);
this.DrawToBitmap(bm, rect);
bm.Save(saveFileDialog.FileName, ImageFormat.Bmp);
}
質問に重複しているとマークされている場合、どのように彼らが尊敬するメッセージを見つけることができますか? –