BMP/DiB and jpg Interchange

Source: Internet
Author: User
Tags bmp image

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.