I have an existing Winforms app that has several forms with the same button images on the two primary buttons for each form (OK and Cancel). The images are set in the VS Designer by setting Image property of Button to "Local resource" and importing the desired image.
I do not have access to the original image files. How do I extract an image from the Image property of a Button control whose Image property has been set this way?
I found a much easier method than manually decoding the Base64.
Assuming your form is called Form1:
This applies to resources with Persistence set to "Embedded in .resx". If Persistence is "Linked at compile time" the image already exists as a file in your project's Resources directory.
Actually the images are not stored in the filesystem, but rather added to the resx file of your Form (e.g. MainForm.resx) as a base64-encoded serialized representation. If you know how to, you could base64-decode that string, save the result in a flatfile and name it correctly (you must know the image type for that).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With