Reducing bitmap size

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 '
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
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

glass_cookieConnect With a Mentor Commented:
Oh, here's a link for you:


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 : )
nexzusAuthor Commented:
thanks a lot dude
You're welcome : )
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.


All Courses

From novice to tech pro — start learning today.