The following two functions exported in jpgvsbmp. dll can be used to interchange BMP files and jpg files,
Bool jpgtobmp (maid, maid, int icolorbit = 24)
Lpjpgfilenameforin: Path of the BMP file
Lpbmpfilenameforout: complete path of the output BMP file
Icolorbit: the number of digits in the color of the converted BMP image (1--2, 4--16, 8--256, others -- 24)
Bool BMP tojpg (maid, maid, bool bcolor, int nquality)
Lpbmpfilenameforin: Path of the BMP file
Lpjpgfilenameforout: complete path of the output JPG file
Bcolor: whether to retain color (true -- retain, false -- convert to 2-color graph)
Nquality: Image Quality (1 ~ 100. The default value 75,100 indicates the highest quality)
The following function exported from jpgvsbmp. dll can save DIB in memory as JPG files.
Bool dibtojpg (hdib, lpcstr lpjpgfilenameforout, bool bcolor, int nquality)
Bcolor: whether to retain color (true -- retain, false -- convert to 2-color graph)
Nquality: Image Quality (1 ~ 100. The default value 75,100 indicates the highest quality)
Note: hdib is declared as handle. Is the return value of globalalloc, where the image data is saved. For more information, see <msdn> dibapi. H (CPP)
Click here to download the Lib file.