谁有Jpg,bmp,wmf,gif相互转换(能读写)的源码例子,好用的Dll或Lib也行,控件不要,100相送! as title! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 据说GDI+可实现,谁尝试过,有具体的例子吗? go to www.codeproject.com and search CxImage 我这里有,但不知如何给你,你也可以在网上搜索:付黎,Flib,PicViewerDemo。你试试看。这个库非常强大,支持多种图片格式,而且提供详细的文档和源代码。 如果要用GDI+,Platform SDK 有具体的例子如下:#include <windows.h>#include <gdiplus.h>#include <stdio.h>using namespace Gdiplus;int GetEncoderClsid(const WCHAR* format, CLSID* pClsid){ UINT num = 0; // number of image encoders UINT size = 0; // size of the image encoder array in bytes ImageCodecInfo* pImageCodecInfo = NULL; GetImageEncodersSize(&num, &size); if(size == 0) return -1; // Failure pImageCodecInfo = (ImageCodecInfo*)(malloc(size)); if(pImageCodecInfo == NULL) return -1; // Failure GetImageEncoders(num, size, pImageCodecInfo); for(UINT j = 0; j < num; ++j) { if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 ) { *pClsid = pImageCodecInfo[j].Clsid; free(pImageCodecInfo); return j; // Success } } free(pImageCodecInfo); return -1; // Failure}int main(){ // Initialize GDI+. GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); CLSID encoderClsid; Status stat; Image* image = new Image(L"Bird.bmp"); // Get the CLSID of the PNG encoder. GetEncoderClsid(L"image/png", &encoderClsid); //根据你的需要调用 stat = image->Save(L"Bird.png", &encoderClsid, NULL); if(stat == Ok) printf("Bird.png was saved successfully\n"); else printf("Failure: stat = %d\n", stat); delete image; GdiplusShutdown(gdiplusToken); return 0;} FLib图象处理库(1.10) http://www.csdn.net/cnshare/soft/openfile.asp?kind=1&id=15124 本封装库对图象读取,特效,显示及压缩算法进行了封装。功能有:对bmp,png,tiff,gif,pcx,tga,jpg等图像格式的读写,进行亮度,对比度,图像旋转,浮雕,颜色反转,锐化,平滑,马赛克处理。包括全部源代码.编译需要较新的SDK! JPEG的读取最好用Intel的IJL,不要用一点1.5版,体积太大了,用1.1版,Google上搜索一下就可以找到下载. 我已用GDI+尝试成功一部分了,虽然慢点,但巨简单,推荐大家一块研究研究!谢谢各位参与!接分 关于VS2010下MFC的状态栏显示时间的问题。 CTreeCtrl有GDI泄露, 怎么搞定啊? 打包 如何在VSTS中上传软件源代码? 新年好!有没有办法通过MAC地址获取其IP地址呢? C高手请进。。有关ftp的win api的使用 用vc生成dll文件,链接时生成了exp,lib文件,打没有dll文件,同时还报错lnk2001 dlg里面怎么调用view里面的变量和函数?---100分 5,5,5,1四个数用+,-,*,/如何得到24 ●●●●我发现一个好工具软件 我使用CListCtrl的REPORT风格,怎样对报表中的数据进行编辑? 线程传递消息有时出现乱码
你试试看。这个库非常强大,支持多种图片格式,而且提供详细的文档和源代码。
#include <gdiplus.h>
#include <stdio.h>using namespace Gdiplus;
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
UINT num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes ImageCodecInfo* pImageCodecInfo = NULL; GetImageEncodersSize(&num, &size);
if(size == 0)
return -1; // Failure pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL)
return -1; // Failure GetImageEncoders(num, size, pImageCodecInfo); for(UINT j = 0; j < num; ++j)
{
if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
{
*pClsid = pImageCodecInfo[j].Clsid;
free(pImageCodecInfo);
return j; // Success
}
} free(pImageCodecInfo);
return -1; // Failure
}
int main()
{
// Initialize GDI+.
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); CLSID encoderClsid;
Status stat;
Image* image = new Image(L"Bird.bmp"); // Get the CLSID of the PNG encoder.
GetEncoderClsid(L"image/png", &encoderClsid); //根据你的需要调用 stat = image->Save(L"Bird.png", &encoderClsid, NULL); if(stat == Ok)
printf("Bird.png was saved successfully\n");
else
printf("Failure: stat = %d\n", stat); delete image;
GdiplusShutdown(gdiplusToken);
return 0;
}
FLib图象处理库(1.10)
http://www.csdn.net/cnshare/soft/openfile.asp?kind=1&id=15124
本封装库对图象读取,特效,显示及压缩算法进行了封装。
功能有:对bmp,png,tiff,gif,pcx,tga,jpg等图像格式的读写,进行亮度,对比度,图像旋转,浮雕,颜色反转,锐化,平滑,马赛克处理。
包括全部源代码.
编译需要较新的SDK!
Google上搜索一下就可以找到下载.
接分