PC Review


Reply
Thread Tools Rate Thread

Bitmaps on forms

 
 
Geoff
Guest
Posts: n/a
 
      6th May 2008
Hi
I have mislaid the bitmap used on a form. Is it possible to 'recover' the
image from the form itself?

Geoff
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> wrote in message
news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> Hi
> I have mislaid the bitmap used on a form. Is it possible to 'recover' the
> image from the form itself?
>
> Geoff



 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> wrote in message
news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> Hi
> I have mislaid the bitmap used on a form. Is it possible to 'recover' the
> image from the form itself?
>
> Geoff


 
Reply With Quote
 
Michel Pierron
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> a écrit dans le message de
news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> Hi
> I have mislaid the bitmap used on a form. Is it possible to 'recover' the
> image from the form itself?
>
> Geoff
>


 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      6th May 2008
Both Andy's and Michel's suggestions are much better than this one!

Regards,
Peter T

"Peter T" <peter_t@discussions> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> > Hi
> > I have mislaid the bitmap used on a form. Is it possible to 'recover'

the
> > image from the form itself?
> >
> > Geoff

>
>



 
Reply With Quote
 
Geoff
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> wrote in message
> news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> > Hi
> > I have mislaid the bitmap used on a form. Is it possible to 'recover' the
> > image from the form itself?
> >
> > Geoff

>

 
Reply With Quote
 
Geoff
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> a écrit dans le message de
> news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> > Hi
> > I have mislaid the bitmap used on a form. Is it possible to 'recover' the
> > image from the form itself?
> >
> > Geoff
> >

>

 
Reply With Quote
 
Geoff
Guest
Posts: n/a
 
      6th May 2008
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
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:E4D14445-4589-4969-8B9A-(E-Mail Removed)...
> > > Hi
> > > I have mislaid the bitmap used on a form. Is it possible to 'recover'

> the
> > > image from the form itself?
> > >
> > > Geoff

> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move forms from one to another project ( including bitmaps ) Peter Stojkovic Microsoft VB .NET 1 21st Nov 2005 09:20 AM
Where are OLE Bitmaps kept? Stephen Lebans Microsoft Access 4 25th Mar 2005 01:52 AM
PPT => Bitmaps Sascha Kerschhofer Microsoft C# .NET 4 8th Sep 2004 04:15 PM
Bitmaps on User Forms...can you make it a jpeg???? novicevbaer Microsoft Excel Programming 0 26th Aug 2004 06:02 PM
bitmaps joe Windows XP General 3 4th Dec 2003 02:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 AM.