【问题标题】:Dispose pictureBox处理图片框
【发布时间】:2013-03-29 06:18:06
【问题描述】:

我在 C++/CLI 中使用 Winform,我有 pictureBox1,我正在尝试编译以下代码,但它失败了:

pictureBox1->Image->Dispose();

编译器告诉 Dispose is not a member of System::Drawing::Image 我尝试在 C# 中使用它并且它可以工作:

pictureBox1.Image.Dispose();

我使用 MS Visual Studio 2010。

【问题讨论】:

  • 你试过delete pictureBox1->Image; pictureBox1->Image = nullptr;

标签: c# .net visual-studio-2010 c++-cli


【解决方案1】:

请尝试执行以下操作,

 delete pictureBox1->Image;   // Dispose the existing bitmap, if any

【讨论】:

    猜你喜欢
    • 2017-01-19
    • 2018-10-28
    • 2014-01-30
    • 1970-01-01
    • 1970-01-01
    • 2011-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多