哪位大哥有BMP转JPG的源代码吗?能给我发一份吗?谢谢了,最近的一个项目需要这个功能,可是我以前不接触图像编程,所以一时写不出JPG的压缩编码程序,急求中,哪位大哥救一下命啊,555555,
我的EMAIL:[email protected]
我的EMAIL:[email protected]
解决方案 »
- 怎么遍历一个listcontrol
- 获取还原窗口的大小
- one or more multiply defined symbols found网上的办法都行不通
- 通过TAB order调整控件层次关系后,发现一个问题:显示在顶层的按钮无法点击。求教~~
- 加了自定义消息后按 CLR+W出错?
- 哪里能买到设计模式原版?
- 如何实现两个完整的皮肤界面文件的切换呢?
- 为什么我的程序不能把字符数组的内容写到文件的末尾??
- 请问各位兄弟,谁有递规扫描文件的算法呀,答者给分!!!!
- 请问怎样用SOCKET实现PING的功能,是发一个ICMP包吗?请高手指点指点小女子
- 下血本求教在lib中使用单例模式...
- 如何让windows把www.abc.com解析为127.0.0.1,一共有哪些方式?急急急!!!
http://www.smalleranimals.com/jpegfile.htmImageHandler: A Component to Copy an HDC Area to a JPEG File
http://codeguru.earthweb.com/bitmap/ImageHandler.htmlWriting a DIB to a JPEG file
http://codeguru.earthweb.com/bitmap/dib_to_jpeg.shtmlCreating a DIB section from a BMP file
http://codeguru.earthweb.com/bitmap/dibsection_from_bmp.shtml
int Bmp2Jpg(char* bmpName,char* jpgName)
{
CLSID codecClsid;
EncoderParameters encoderParameters;
long quality;
Status stat; USES_CONVERSION;
Image image(A2W(bmpName));
// Get the CLSID of the JPEG codec.
GetCodecClsid(L"image/jpeg", &codecClsid);
encoderParameters.Count = 1;
encoderParameters.Parameter[0].Guid = EncoderQuality;
encoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
encoderParameters.Parameter[0].NumberOfValues = 1;
// Save the image as a JPEG with quality level 0.
quality = 0;
encoderParameters.Parameter[0].Value = &quality; // Save the image as a JPEG with quality level 100.
quality = 100;
encoderParameters.Parameter[0].Value = &quality;
stat = image.Save(A2W(jpgName), &codecClsid, &encoderParameters);
if(stat == Ok)
return TRUE;
else
return FALSE;
}