Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JPEG compressing without DLLs

Tags:

c++

c

windows

jpeg

I want to convert raw RGB image data (I could add BMP header if necessary) to JPEG on Windows. Is it possible to do so without DLLs? I tried statically compiling IJG jpeglib, but I have VC++ 9, and it only works for VC++ 10

like image 231
Lem0n Avatar asked Dec 12 '25 22:12

Lem0n


1 Answers

Use GDI+ to save the image to a file. For example, see http://msdn.microsoft.com/en-us/library/ms535407(VS.85).aspx for how to save to a file. Specify the JPEG encoder. To load the image into the Image class, you can use the Bitmap class (inherits from Image). Several methods are available: http://msdn.microsoft.com/en-us/library/ms536286(VS.85).aspx.

GDI+ comes with Windows XP and newer and can be redistributed for older Windows versions. So you probably won't need to bundle anything newer.

like image 162
James Johnston Avatar answered Dec 14 '25 12:12

James Johnston