Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bit map compression

Posted on 1999-07-12
5
Medium Priority
?
231 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:waderain
[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
5 Comments
 
LVL 1

Expert Comment

by:michelv
ID: 1523798
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
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1523799
afiak VB cannot save to gif/jpg.
You have to use an external tool to do that.
So PSP or Photoshop or some OCX
0
 
LVL 7

Accepted Solution

by:
Vbmaster earned 400 total points
ID: 1523800
Code to save a StdPicture object can be found at:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm
0
 

Author Comment

by:waderain
ID: 1523801
Excellent code. Exactly what I was looking for!
0
 

Author Comment

by:waderain
ID: 1523802
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
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

661 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