Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleGrab an image of part of the desktop and save it in a JPEG file on the desktop
DescriptionThis example shows how to grab an image of part of the desktop and save it in a JPEG file on the desktop in Visual Basic 6.
Keywordsdesktop image, background, JPEG, JPG
CategoriesGraphics, Windows
 
Thanks to Neil Crosby.

When it starts, the program grabs an image of the desktop and displays it. When you click and drag to select an area on the image, the program then uses Intel's JPEG library to save the image in a JPEG file on the desktop. See the code for details.

The zip file contains Microsoft's ITMalloc.tlb file. A reference to the ITMalloc.tlb must be made in the project file. (In VB6, it is under Project, References)

This program requires Intel's JPEG library, which you can download here.

Install the library and copy ijl15.dll into the Windows\System directory.

Because this program grabs an image of the screen as it is shown when you start the program, you may want to compile it into an executable and place it on your desktop. Then you can start the executable without obscuring much of the desktop. If you run it in the Visual Basic IDE, most of the desktop is covered by the IDE.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated