在visual studio 2017错误中,操作时间比预期的要长

问题描述 投票:0回答:1

我确信我的代码100%运行并运行窗口窗体,其中包含一个按钮来选择图片并在ImageBox中显示它但发生了错误。我不知道是什么原因,我将展示图片以澄清它。

我正在使用Visual Studio 2017 c ++

enter image description here

#pragma endregion
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

    Stream^ myStream;
    OpenFileDialog^ openfiledialog1 = gcnew OpenFileDialog;
    PictureBox^ pctBox = gcnew PictureBox;

    if (openFileDialog1->ShowDialog()== System::Windows::Forms::DialogResult::OK)
    {
        if ((myStream = openFileDialog1->OpenFile()) != nullptr)
        {
            String^ strFileName = openFileDialog1->InitialDirectory + openFileDialog1->FileName;
            //MessageBox::Show(strFileName);
            pctBox->Load(strFileName);
            myStream->Close();
        }
    }

}
c++-cli
1个回答
0
投票

根据提供的非常有限的信息,您似乎正在尝试从映射的网络驱动器加载图像,该驱动器性能很差。您可以使用perfmon来监控系统性能

© www.soinside.com 2019 - 2024. All rights reserved.