private: System::Void saveF2ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
if (pictureBox1->Image != nullptr)
{
SaveFileDialog^ savedialog = gcnew SaveFileDialog();
savedialog->Filter = "Image Files(*.BMP)|*.BMP;*.GIF|Image Files(*.JPG)|*.JPG|Image Files(*.GIF)|*.GIF|All files (*.*)|*.*";
savedialog->RestoreDirectory = true;
savedialog->InitialDirectory = "c:\\";
if (savedialog->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
pictureBox1->Image->Save(savedialog->FileName, System::Drawing::Imaging::ImageFormat::Jpeg);
}
}
}