该DLL提供两个函数接口
1. 转换处理主函数
int BMP2PNG(char *file);
参数
file
需要转换的文件,包括全路径名:如C:\ABC.bmp
返回值
成功返回0,不成功返回非零值
2. 信息返回函数
unsigned long GetInfoLog();
参数
无
返回值
返回错误代码
注释
当主函数返回值为1时,该函数返回的是GetLastError函数的错误代码
当主函数返回值为2时,该函数返回的是转换状态的错误代码
附加
转换状态的错误代码
typedef enum {
Ok = 0,
GenericError = 1,
InvalidParameter = 2,
OutOfMemory = 3,
ObjectBusy = 4,
InsufficientBuffer = 5,
NotImplemented = 6,
Win32Error = 7,
WrongState = 8,
Aborted = 9,
FileNotFound = 10,
ValueOverflow = 11,
AccessDenied = 12,
UnknownImageFormat = 13,
FontFamilyNotFound = 14,
FontStyleNotFound = 15,
NotTrueTypeFont = 16,
UnsupportedGdiplusVersion = 17,
GdiplusNotInitialized = 18,
PropertyNotFound = 19,
PropertyNotSupported = 20,
ProfileNotFound = 21
} Status;
1. 转换处理主函数
int BMP2PNG(char *file);
参数
file
需要转换的文件,包括全路径名:如C:\ABC.bmp
返回值
成功返回0,不成功返回非零值
2. 信息返回函数
unsigned long GetInfoLog();
参数
无
返回值
返回错误代码
注释
当主函数返回值为1时,该函数返回的是GetLastError函数的错误代码
当主函数返回值为2时,该函数返回的是转换状态的错误代码
附加
转换状态的错误代码
typedef enum {
Ok = 0,
GenericError = 1,
InvalidParameter = 2,
OutOfMemory = 3,
ObjectBusy = 4,
InsufficientBuffer = 5,
NotImplemented = 6,
Win32Error = 7,
WrongState = 8,
Aborted = 9,
FileNotFound = 10,
ValueOverflow = 11,
AccessDenied = 12,
UnknownImageFormat = 13,
FontFamilyNotFound = 14,
FontStyleNotFound = 15,
NotTrueTypeFont = 16,
UnsupportedGdiplusVersion = 17,
GdiplusNotInitialized = 18,
PropertyNotFound = 19,
PropertyNotSupported = 20,
ProfileNotFound = 21
} Status;
dll源码 参考博文 自己用GDI+封装的BMP转PNG格式图片的dll(二)
下载链接:http://download.youkuaiyun.com/source/3486711
本程序仅供爱好者们学习娱乐,不得用做任何商业用途,否则后果自负。