Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Saving BMP to Jpeg format in VB 6

Posted on 2001-07-27
11
Medium Priority
?
498 Views
Last Modified: 2013-11-19
Is there any source-code for saving .bmp to .jpeg files.
I would like it if somebody can point me to a source that doesn't actually require DLL's or Classes. If not, could someone explain to me how to do this. The sources i've found on the net only contain links or require DLL's, witch is a hassle.

VB saves files as .JPG but the size is too big (+1.1M.)
This is for a screen capture at 800*600 res. & 16 Bit Colours. I know VB uses your current settings to save the pic, but i can't run the program at 256 Colours.

If no one knows of any source code or sites that can help me in this, I would appreciate it if there is a link to a compression utility/coding/app that i can use/find.

Much credit will be given and more if available.

Thanx :)!
0
Comment
Question by:Kosie2K
  • 2
  • 2
  • 2
  • +4
11 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 6326933
I've never seen this done in VB, the only open source code I've seen for Jpeg is the Independent JPEG Group's work which is in C.

http://www.ijg.org/
0
 
LVL 2

Expert Comment

by:dwalsarie
ID: 6326937
If you would not want to use DLL's or Classes,
the JPEG compression would get really slow, and
you would have a lot of code which is really difficult.

I used this approach: the free Intel JPEG Library
A complete demo and tutorial can be found at
http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm
0
 
LVL 1

Expert Comment

by:darthg8r
ID: 6326940
I'd check planet source code.  They are great resource for things like that.  
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Expert Comment

by:darthg8r
ID: 6326945
I guess I could give you the URL couldn't I.  DUH.  http://www.planet-source-code.com
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6326954
www.smalleranimals.com offers an excellent image processing DLL (ImgSource) that is relatively easy to use with VB.  It costs around $25.

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm has code and links to a freeware DLL that can be used to save to JPG.  (This is probably the code you are talking about, but it is probably your best solution for free, unless you wish to translate IJG's work to VB--not an easy task!)
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6327220
it seems someone sent me pure VB code to save as JPG a while back, but i wont know until i get home.  if i remember correctly, it was some long, ugly code, and most surely, performed much slower than its C equivalent.
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 225 total points
ID: 6333083
Hi!

Here's a file over the net for you:

Download...
http://www.planetsourcecode.com/upload/ftp/CODE_UPLOAD6309612000.zip

Description: This Code is for Converting a Windows Bitmap to a Jpeg file. All the code is there for you to do what you like Also the Code for the DLL file I must Tell you That it has been wrote in Delphi 4 if you have any problums with the dll then let me now.

AND

Download...
http://www.planetsourcecode.com/upload/ftp/CODE_UPLOAD58565172000.zip

Description: I wrote a little dll. You can convert a bitmap to a jpeg image (with Compress quality) or a jpeg to bitmap image. You can also capture the desktop in both formats (if You are using more then 256 colors).

That's it!

glass cookie : )
0
 

Author Comment

by:Kosie2K
ID: 6333617
To: glass cookie.

your dll works sort of but i need a more descriptive explanation of all it's functions.. I have read the Txt Document but am still a little confused... Also the first link you provided gave me an DLL but REGSVR32 can't register it.

is there any e-mail address where i can contact you?

If need be send it to Kosie2k@yahoo.com

Thanx! :)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6333628
Kosie2K, the reason regsvr32 doesn't work is that the dll is a standard dll not an activex dll. Only activex dlls need to be registered, a standard dll is accessed in a different way: Private Declare Function BmpToJpeg Lib "JPeg32.dll" (ByVal BmpFilename As String, ByVal JpegFilename As String, ByVal Quality As Integer) As Integer from the jpeg32 activex control.
0
 

Author Comment

by:Kosie2K
ID: 6333650
Thanx a lot! :)

It does work but i have to play with it still to get it under control....

One other question... Is this Open Source or not?
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6333724
Sorry... it isn't my dll - It's written by someone : |
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…
Suggested Courses

824 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