Click to See Complete Forum and Search --> : How to get this resource?


bucz
July 26th, 2007, 09:09 AM
I have inclded jpg file. In jpg I have included you can see that I have some Resource file MyResources.resx in folder Resource Files in my solution. Inside I have some png file (mypng.image) Now how should I use it in my code?

I want to put it on some button. Original code from button when you include some image looks like this:

System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));

this->button_send_continously->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button_send_continously.Image")));


How to "link" my image from other resource file there?

cilu
July 26th, 2007, 09:19 AM
[ redirected ]

bucz
July 26th, 2007, 09:25 AM
errrr,

is that some comment or an answer to my post?

VictorN
July 26th, 2007, 09:42 AM
You posted your question to the wrong Forum.
Now your question has been redirected to the Forum where there are more people understanding the problems you have.

bucz
July 30th, 2007, 01:54 AM
SOLVED

I have made it in this way:

System::Resources::ResourceManager ^ rm = gcnew System::Resources::ResourceManager("ControlTest.Myresx", System::Reflection::Assembly::GetExecutingAssembly() );

this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^ >(rm->GetObject(L"myimage")));



System::Reflection::Assembly::GetExecutingAssembly() allows me to get a resource from my process.

ashukasama
July 30th, 2007, 02:07 AM
Good :)