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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With