extern "C"
{
#include <stdio.h>
#include <stdlib.h>
#include <jpeglib.h>
}
typedef long LONG;
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef struct {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BMPFILEHEADER_T;
typedef struct{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BMPINFOHEADER_T;
void savebmp(uchar * pdata, char * bmp_file, int width, int height )
{ //分别为rgb数据,要保存的bmp文件名,图片长宽
int size = width*height*3*sizeof(char); // 每个像素点3个字节
// 位图第一部分,文件信息
BMPFIL
将rgb图像数据保存为BMP格式图片的方法
最新推荐文章于 2024-05-11 21:23:20 发布