Solved

Reducing bitmap size

Posted on 2001-06-23
4
696 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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