473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to change BMP file to JPEG/JPG file using VC++/C++

Hi,

I have created one application using vc++. In that, I captured and stored desktop image as bmp image format, now i want to convert it into jpeg/jpg format in vc++/c++. How can I do this......
Jan 27 '10 #1
6 5479
Banfa
9,065 Expert Mod 8TB
Either you get and read the jpeg specification and write a jpeg encoder yourself or you find a third party library at a cost you are willing to pay and use that to write out your jpeg files.

I have never had to output jpegs so I have no library recomendations, sorry.
Jan 27 '10 #2
Airslash
221 100+
use the GDI functions from the Graphics namespace if you're on .NET or link against the gdi32 dll and use the direct GDI functions.

then you have the opportunity to load images as bmp or jpg and save them as bmp or jpg. You can even work with em and manipulate em.

and GDi is pretty fast as well since it works partially on the hardware instead of the CPU
Jan 27 '10 #3
johny10151981
1,059 1GB
Dear Airslash,
can you please explain this line.
GDi is pretty fast as well since it works partially on the hardware instead of the CPU

This line fly away over my head like a rocket before i have understood anything at all.

Regards,
Johny
Jan 27 '10 #4
Airslash
221 100+
Sure,

we are currently using these technologies for our software here at work and the difference is that when you use the standard classes such as a memory stream and other input/output methods for reading the data of a image and then manipulate it, you do this using the processor.

If you use GDI, these things are done on the hardware of the graphics card, The GPU.

To give an example, we resized a jpg from 3megapixels to standard VGA. using a Duel Core cpu we needed about 26 miliseconds to do this. Using GDI and CUDA technologies we only need 6 miliseconds.

Thats what I ment with beeing faster on the hardware.
Jan 27 '10 #5
johny10151981
1,059 1GB
Airslash,
Thank you for these information.
I am asking you again this GDI is only blong to .net or under GDI 32?
Jan 27 '10 #6
Airslash
221 100+
both.

you can use GDI directly by linking against the lib and dll supplied by Windows, or you can use the Graphics namespace in .NET

look up GDI on the msdn, it has complete articles and guides on how to use it
Jan 27 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: google12 | last post by:
hi, May anyone help me? I need a lib which support .jpeg file with RGBA mode. PIL seems to support RGB and CMYK mode only... Thanks for your help.
4
by: sree | last post by:
i am doing project a simple http server. it is being writen in c using sockets. so when there is a request to read a jpeg or any other file icant do it. my code is working only for html and txt...
0
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the...
2
by: Harry Whitehouse | last post by:
Hello! I have some ASPX code which creates a JPEG file in response to a button press. The JPEG file is contructed in memory (see below), stored to a JPEG file on the server, and then dished-out...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
7
by: Martin Pritchard | last post by:
Hi, Sorry for my ignorance, but I'm a bit new to C++. I've been handed over a C++ app written in VS2002 which I have to convert to VS2005. Apparently it's been written in a C style, but cannot...
4
by: Charles | last post by:
Hello Everyone, I have been gettting great feedback from microsoft.public.vc.language group but after doing more searching I think my post should be directed to this group. I am trying to make...
1
by: htres | last post by:
Hello, I'm new to programming and C#, so please bear with my ignorance! I need to extract jpeg images and header data from a binary file. The binary file is formatted with several fixed...
3
by: amit | last post by:
Hello group, I'm uploading some image files such as jpeg, png and gif. However, I must convert time to jpeg type. I have few questions: 1) Can I convert time in using gd library? 2)...
2
by: bahnfire | last post by:
Hi, I am hoping that I finally have the right group :-) I am using Visual C++ Express 2008 and am trying to change the taskbar icon that I am using (notifyIcon1) as some state changes (button...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.