Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well that was careless wasn't it !
Drag your form into a new project, remove all controls, PictureSizeMode=0, size the form to at least the size of the picture, maybe change PictureAlignment. You've probably got some image app that has a screen capture facility. If not try this in the form. Private Declare Sub keybd_event Lib "user32" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Const VK_SNAPSHOT = 44 ' &H2C Const VK_LMENU = 164 Const KEYEVENTF_KEYUP = 2 Const KEYEVENTF_EXTENDEDKEY = 1 Private Sub UserForm_Click() DoEvents keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0 ' key down keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0 keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 DoEvents MsgBox "Form image in Clipboard" End Sub Paste into an image processor that can crop the bmp from the image of the form, I use IrfanView.com Regards, Peter T "Geoff" wrote in message ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Both Andy's and Michel's suggestions are much better than this one!
Regards, Peter T "Peter T" <peter_t@discussions wrote in message ... Well that was careless wasn't it ! Drag your form into a new project, remove all controls, PictureSizeMode=0, size the form to at least the size of the picture, maybe change PictureAlignment. You've probably got some image app that has a screen capture facility. If not try this in the form. Private Declare Sub keybd_event Lib "user32" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Const VK_SNAPSHOT = 44 ' &H2C Const VK_LMENU = 164 Const KEYEVENTF_KEYUP = 2 Const KEYEVENTF_EXTENDEDKEY = 1 Private Sub UserForm_Click() DoEvents keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0 ' key down keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0 keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 DoEvents MsgBox "Form image in Clipboard" End Sub Paste into an image processor that can crop the bmp from the image of the form, I use IrfanView.com Regards, Peter T "Geoff" wrote in message ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But thank you for your response as well. It did work - of course.
And both were so quick and simple to implement. Geoff "Peter T" wrote: Both Andy's and Michel's suggestions are much better than this one! Regards, Peter T "Peter T" <peter_t@discussions wrote in message ... Well that was careless wasn't it ! Drag your form into a new project, remove all controls, PictureSizeMode=0, size the form to at least the size of the picture, maybe change PictureAlignment. You've probably got some image app that has a screen capture facility. If not try this in the form. Private Declare Sub keybd_event Lib "user32" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Const VK_SNAPSHOT = 44 ' &H2C Const VK_LMENU = 164 Const KEYEVENTF_KEYUP = 2 Const KEYEVENTF_EXTENDEDKEY = 1 Private Sub UserForm_Click() DoEvents keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0 ' key down keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0 keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0 DoEvents MsgBox "Form image in Clipboard" End Sub Paste into an image processor that can crop the bmp from the image of the form, I use IrfanView.com Regards, Peter T "Geoff" wrote in message ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
In the Properties window go to the Picture property of the control that contains the image. CTRL+C to copy the image. Now paste the image into Paint or some other graphics package that will allow you to save the image. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Geoff" wrote in message ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that saved the 'day'.... and the image. <g
Geoff "Andy Pope" wrote: Hi, In the Properties window go to the Picture property of the control that contains the image. CTRL+C to copy the image. Now paste the image into Paint or some other graphics package that will allow you to save the image. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Geoff" wrote in message ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Geoff,
With a button on the userform: Private Sub CommandButton1_Click() Select Case Me.Picture.Type Case 1: SavePicture Me.Picture, "c:\SaveImg.bmp" Case 2, 4: SavePicture Me.Picture, "c:\SaveImg.wmf" End Select End Sub "Geoff" a écrit dans le message de ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Michael
Neat. Thanks for that. Geoff "Michel Pierron" wrote: Hi Geoff, With a button on the userform: Private Sub CommandButton1_Click() Select Case Me.Picture.Type Case 1: SavePicture Me.Picture, "c:\SaveImg.bmp" Case 2, 4: SavePicture Me.Picture, "c:\SaveImg.wmf" End Select End Sub "Geoff" a écrit dans le message de ... Hi I have mislaid the bitmap used on a form. Is it possible to 'recover' the image from the form itself? Geoff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
disappearing bitmaps in worksheet | Excel Discussion (Misc queries) | |||
problem with bitmaps | New Users to Excel | |||
sending bitmaps through Lotus notes | Excel Programming | |||
Download Source for Bar Chart Bitmaps? | Charts and Charting in Excel | |||
Bitmaps on User Forms...can you make it a jpeg???? | Excel Programming |