原型:
char * WINAPI icePub_getBufferFromImg2(char *strImgFilename,int *width,int *height,int huiGrade)
输入:strImgFilename 图片文件名
huiGrade 图像灰度化标志,0 no; >1 and <=256 灰度级
输出:width 图像宽度
height 图像高度
返回值:图像的点阵数据(按照24位BMP格式)
extern "C"
{
__declspec(dllexport)
char * WINAPI icePub_getBufferFromImg2(char *strImgFilename,int *width,int *height,int huiGrade);
}
#pragma comment(lib,"icePubDll.lib")
char *bmpBuffer=NULL;
int imgWidth, imgHeight;
bmpBuffer = icePub_getBufferFromImg2 ("e:\\a.jpg",&imgWidth,&imgHeight,0);
//然后对bmpBuffer数据处理即可
if(bmpBuffer != NULL)
free(bmpBuffer);
原型:
int WINAPI icePub_makeBmpFile(char *strBmpFilename,char *bmpBuffer,int height,int width)
输入:strBmpFileName 待生成图像文件名
bmpBuffer 图像点阵数据(按照24位BMP格式)
height 图像高
width 图像宽
输出:
extern "C"
{
__declspec(dllexport)
char * WINAPI icePub_getBufferFromImg2(char *strImgFilename,int *width,int *height,int huiGrade);
__declspec(dllexport)
int WINAPI icePub_makeBmpFile(char *strBmpFilename,char *bmpBuffer,int height,int width);
}
#pragma comment(lib,"icePubDll.lib")
char *bmpBuffer=NULL;
int imgWidth, imgHeight;
bmpBuffer = icePub_getBufferFromImg2 ("e:\\a.jpg",&imgWidth,&imgHeight,0);
//然后对bmpBuffer数据处理即可
icePub_makeBmpFile("e:\\a.bmp",bmpBuffer,imgWidth,imgHeight);
if(bmpBuffer != NULL)
free(bmpBuffer);