S
Steve McKewen
I am using VS2005 in a cli managed application.
I have buttons which load icon files to use as button images.
I use icons so that the images are already transparent when placed. The IDE
converts these to images and stores them in the form resx file, and I change
them like this:
this->btnReplay->Image = Image::FromFile("ButtonDown.ico");
I want to keep the icons in a resource file and load them from there, but I
am having trouble converting the resource icons to images. This works OK
System:rawing::Icon^ aDownIcon = (cli::safe_cast<System:rawing::Icon^
But I can't cast the icon to an Image in order to assign it to the button's
image property.
Is there a simple way to do this?
Steve
I have buttons which load icon files to use as button images.
I use icons so that the images are already transparent when placed. The IDE
converts these to images and stores them in the form resx file, and I change
them like this:
this->btnReplay->Image = Image::FromFile("ButtonDown.ico");
I want to keep the icons in a resource file and load them from there, but I
am having trouble converting the resource icons to images. This works OK
System:rawing::Icon^ aDownIcon = (cli::safe_cast<System:rawing::Icon^
(aResourceManager->GetObject("ButtonDown")));
But I can't cast the icon to an Image in order to assign it to the button's
image property.
Is there a simple way to do this?
Steve