我希望能够使用文本文件中的文本保存位图图像,因此当我打开它时,文本和位图文件都会打开并且可以在以后查看。这是我当前保存位图图像的代码:
{
//Show a save dialog to allow the user to specify where to save the image file
using (SaveFileDialog dlgSave = new SaveFileDialog())
{
dlgSave.Title = "Save Image";
dlgSave.Filter = "Bitmap Images (*.bmp)|*.bmp|All Files (*.*)|*.*";
if (dlgSave.ShowDialog(this) == DialogResult.OK)
{
//If user clicked OK, then save the image into the specified file
using (Bitmap bmp = new Bitmap(capturebox.Width, capturebox.Height))
{
capturebox.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
bmp.Save(dlgSave.FileName);
}
}
}
}
所以我需要它将文本保存在一个名为 ExtraNotes 的标签中,然后能够打开图片框(捕获框)中的图像和标签中的文本。请帮忙,
谢谢