Hello,
I have a UserForm with a few buttons.
Using PROPERTIES, I have attached a nice bitmap picture to each button (a long time ago).
I want to modify a picture, but I lost the source bitmap picture (.gif).
Where does the UserForm store the picture?
Is there a way I can retrieve the picture, so that I can modify it, and then reinsert it on the button?
Thanks
Leon Lai
Is there any way to recover the bitmap image in a button?
-
- Lounger
- Posts: 47
- Joined: 12 Sep 2021, 14:50
-
- 4StarLounger
- Posts: 563
- Joined: 27 Jun 2021, 10:46
Re: Is there any way to recover the bitmap image in a button?
SavePicture CommandButton1.Picture, "<folder_i_want_to_save_in>\buttonpic1.bmp"
-
- Lounger
- Posts: 47
- Joined: 12 Sep 2021, 14:50
Re: Is there any way to recover the bitmap image in a button?
Hello SpeakEasy
Thanks for reply.
I don't quite understand what you are suggesting.
Could you please elaborate a little?
Is the picture found in a folder? Which path?
Leon
Thanks for reply.
I don't quite understand what you are suggesting.
Could you please elaborate a little?
Is the picture found in a folder? Which path?
Leon
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there any way to recover the bitmap image in a button?
See the attached sample workbook. Clicking the button on the userform will save its picture to your Documents folder.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 47
- Joined: 12 Sep 2021, 14:50
Re: Is there any way to recover the bitmap image in a button?
Hello Hans
That's great! It works.
Thanks a lot.
Leon
That's great! It works.
Thanks a lot.
Leon
-
- 4StarLounger
- Posts: 563
- Joined: 27 Jun 2021, 10:46
Re: Is there any way to recover the bitmap image in a button?
>Is the picture found in a folder? Which path?
No, for want of a better description that avoids the use of the oleobjectblob, it is stored in the button. The code I provided shows how to save the picture stored in a specific button to a named file in a folder as a bitmap
Hans' link does exactly the same thing. Despite giving the filename a gif extension, SavePicture still saves it as a bitmap, not a gif
No, for want of a better description that avoids the use of the oleobjectblob, it is stored in the button. The code I provided shows how to save the picture stored in a specific button to a named file in a folder as a bitmap
Hans' link does exactly the same thing. Despite giving the filename a gif extension, SavePicture still saves it as a bitmap, not a gif
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there any way to recover the bitmap image in a button?
My sample workbook was only meant as an illustration of your code, not as something new.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 563
- Joined: 27 Jun 2021, 10:46
Re: Is there any way to recover the bitmap image in a button?
No problem - I was really just clarifying that it does NOT result in a gif
-
- Administrator
- Posts: 78596
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there any way to recover the bitmap image in a button?
Thanks for that, I didn't know that.
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 47
- Joined: 12 Sep 2021, 14:50
Re: Is there any way to recover the bitmap image in a button?
Hello SpeakEasy
Now, I understand your suggestion.
I tried your code in my button:
------
Private Sub CommandButton1_Click()
SavePicture Me.CommandButton1.Picture, "D:\TEST\myPic.bmp"
End Sub
-------
It works great!
Best Regards,
Leon