I tried to set the
BackgroundImage
property of a form with a PNG image (the PNG image was stored in the
Form1.resX file), and the designer added these lines in the
InitializeComponent
method:
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew
System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->SuspendLayout();
...
this->BackgroundImage = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"$this.BackgroundImage")));
...
}
So I suppose you can use
ComponentResourceManager
class and
GetObject
method with the appropriate name.