Link to home
Start Free TrialLog in
Avatar of nexzus
nexzus

asked on

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 '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,
ASKER CERTIFIED SOLUTION
Avatar of glass_cookie
glass_cookie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nexzus
nexzus

ASKER

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.

Thanks,

ralan2