Solved

Reducing bitmap size

Posted on 2001-06-23
4
700 Views
Last Modified: 2007-12-19
Hi currently I'm using Api to capture my scree. Then coe is below:
'Api to Sent Keyboard Events
'I shall use this to sent the "Print Screen " Key which will store the Screen in the clipboard
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As
Long, ByVal dwExtraInfo As Long)
Public Function SaveScreen(ByVal SaveFilePath As String) As Boolean
Call keybd_event(vbKeySnapshot, 1, 0, 0) 'Emulate The PrintScreen Key.
SavePicture Clipboard.GetData(vbCFBitmap), SaveFilePath
End Function
'This code was done with reference to 'http://www.planet-source-code.com/xq/ASP/txtCodeId.1621/lngWId.1/qx/vb/scripts/ShowCode.htm
I run the function and say the file to %systemdir\screenshot.bmp
Now the problem is this. I find the .Bmp file very big.
The above code save the bmp as 24-bit bitmap i think. How do i reduce the resolution? I would like to
reduce it to 16-Bit bitmap if possible. And is it possible to save the screen as .gif or .jpg?
The main Reson in doing this is to reduce the size of the file to as small as possible. Any other suggestions?
I've seen many code that claims to be able to either convert it to 256 color or change it to jpg format.  PRoblem is that all the codes are too complicated. I do not understand them...I'm very much open to suggestion
         
Thanks,
0
Comment
Question by:nexzus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
glass_cookie earned 100 total points
ID: 6223209
Oh, here's a link for you:

Download...
http://www.planetsourcecode.com/upload/ftp/CODE_UPLOAD8599842000.zip

Description: This is a dll I wrote. You can get desktop(in bmp or jpg), You can convert BMPtoJPG or JPGtoBMP, You can RotateLeft, RotateRight and You can make Grayscale a picture with it. I have included the dll Source code. Enjoy

That's it!

glass cookie : )
0
 

Author Comment

by:nexzus
ID: 6227241
thanks a lot dude
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6228406
You're welcome : )
0
 

Expert Comment

by:ralan2
ID: 13077258
The page referenced above is gone.  Can someone post the code here.  I need to obtain the height and width of a bitmap created in VB using the old GDI API.

Thanks,

ralan2
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question