Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Bitmaps on forms

Hi
I have mislaid the bitmap used on a form. Is it possible to 'recover' the
image from the form itself?

Geoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Bitmaps on forms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Bitmaps on forms

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
disappearing bitmaps in worksheet ian h Excel Discussion (Misc queries) 3 August 1st 08 07:53 PM
problem with bitmaps dhw New Users to Excel 0 March 29th 08 04:26 PM
sending bitmaps through Lotus notes [email protected] Excel Programming 0 June 1st 06 09:48 AM
Download Source for Bar Chart Bitmaps? Mitch Powell Charts and Charting in Excel 1 July 21st 05 08:50 PM
Bitmaps on User Forms...can you make it a jpeg???? novicevbaer[_7_] Excel Programming 0 August 26th 04 06:02 PM


All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"