Link to home
Start Free TrialLog in
Avatar of waderain
waderain

asked on

Bit map compression

I'm writing a small graphic program. Does anybody know how to compress a bit map when it is saved? Like in Photoshop when you save a jpg or gif it will compress the size of the file to a smaller size.
Any information is welcome
Justin Gibson
Avatar of michelv
michelv

Well, usually a Bitmap isn't compressed (a .BMP), but it can be done, using RLE compression (Run Length Encoding). RLE uses this scheme:

Say you have six black pixels:

0 0 0 0 0 0

with RLE it gets compressed to this:

6 0

Anyway, for better explanation search using www.mamma.com or something like that for RLE compression, or JPEG compression or ....


Greetz,

Michel
afiak VB cannot save to gif/jpg.
You have to use an external tool to do that.
So PSP or Photoshop or some OCX
ASKER CERTIFIED SOLUTION
Avatar of Vbmaster
Vbmaster

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 waderain

ASKER

Excellent code. Exactly what I was looking for!
Vbmaster (or anyone else that can help me out),

I went to the vbaccelerator site (http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm) and got the bitmap compression code. It worked great but I found if you save and reopen a design more than 9 or 10 times the design slowly starts to turn yellow, Do you know how I can fix it? I sent a  e-mail off to the guy at vbaccelerator but he never got back to me.

Thanks again
Justin Gibson