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

x
?
Solved

Source code for converting jpg to bmp

Posted on 2000-02-17
6
Medium Priority
?
344 Views
Last Modified: 2013-11-19
I'm looking for source code for
converting from jpg & gif image file to black & white bmp file.

(Windows NT & jdk 1.1.8, or c++)

I need your help.
Thanks in advance.
:>)
0
Comment
Question by:lmh110697
[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
6 Comments
 
LVL 2

Expert Comment

by:coopa
ID: 2539646
Have a look here for the Jpeg source...

ftp://ftp.uu.net/graphics/jpeg
0
 

Expert Comment

by:TSMITH
ID: 2557243
This is where I get my routines from. I'm in the process of classing my own format load/save, but jpeg is out of my league at present ;) anyhow, hope these help...

http://www.smalleranimals.com/jpegfile.htm

http://www.codeguru.com/bitmap/index.shtml

0
 
LVL 6

Expert Comment

by:edey
ID: 2570282
If you know how to load a jpeg/gif, the easiest method it to blt it to a bmp and save the result :)


As far as converting it to b/w (if it isn't already) you have a couple of options:

1)Let windows do it by creating the bmp with a b/w palette
2)do your own conversion, perhaps something like this (for a 24bit bmp)
  result = sqrt(red*red+green*green+blue*blue)*(255/441)


GL
Mike



GL
Mike
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

Expert Comment

by:sunsetyang
ID: 2607700
You can see the source of Delphi 4's jpeg library if you have Delphi.In Delphi3 it was on the cdrom and written in C.You can check.GIF uses LZW coding,You can visit:
http://www.cubic.org/source/archive/fileform/graphic/
to see the coding method.
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2696308
here is how I would do it:

use OleLoadPicture to load the image which can then be rendered using the IPicture interface and the Render method.

Because you can render it to any dc including a memory DC you can then save the image to a BMP

This technique will also work for .gif as well
0
 

Accepted Solution

by:
aegana earned 100 total points
ID: 2709767
Try this page. There is a Delphi implementation of a program that converts images from BMP to JPG (or from JPG to BMP). It also have the source code.

http://www.efg2.com/lab/Graphics/BMPJPG.htm
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

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
Suggested Courses

688 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