Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

a command like PRINTFORM that saves as bmp file

I need a command similar to PrintForm that will save my screen to a file on my hard drive called something like x.bmp.

My High School tests show the results of the student's test on the screen and the screen is sent to the printer with the following in a command object called "PRINT".

frmReport.Printform

I would now like to save a copy of this test on the hard drive in a folder called "PRINTOUTS". These would have sequential filenames like 1.bmp, 2.bmp etc.

There must be a simple way to save the screen as a bmp file from visual basic.
The PrintScreen key seems to do this, so there must be a simple command from vb for it.

I use visual basic 4 bacause it meets my needs and I am comfortable with it. I have VB6 but feel awkward and slow with it.
0
HowardAppel
Asked:
HowardAppel
  • 3
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Microsoft has a great project in their Knowledge Base that does screenshots via API's only...

The routines in the example can:

Capture the entire contents of a form.
Capture the client area of a form.
Capture the entire screen.
Capture the active window on the screen.
Capture any portion of any window given a handle to it.
Create a Picture object from a bitmap and a palette.
Print a Picture object as large as possible on the page.

It can be found here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;161299&Product=vb6

To save the captured area, use the SavePicture() function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbstmsavepicture.asp

~IM
0
 
JackOfPHCommented:
SavePicture Clipboard.GetData(vbCFBitmap), strFile
0
 
JackOfPHCommented:
place this on the keydown event of a form or a command button.

if keycode = vbkeyprint then
     SavePicture Clipboard.GetData(vbCFBitmap), strFile
end if
0
 
JackOfPHCommented:
strfile is the path where you want to put file including its name:
for example
c:mydocument\yourfile.bmp
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now