版本:CVI2012
函数:
int GetBitmapFromFile(const char fileName[], int *bitmap);
参数:
fileName[] :图像的路径名
bitmap :存储对象
作用:
从文件目录中读取图像并储存
示例:
将存储在e盘下的图像 temp.bmp 读取出来,存储在 dstImage 中。
static Image *dstImage;
dstImage = imaqCreateImage(IMAQ_IMAGE_U8, 2);
char fileName[512];
GetBitmapFromFile ("e:\\temp.bmp", &dstImage);
如果需要删除该图像,可以用 DiscardBitmap() 函数:
DiscardBitmap(dstImage);
PS:
腾讯云开学季优惠:
【腾讯云】多款云产品1折起,买云服务器送免费机器,最长免费续3个月
【腾讯云】爆款云服务器限时体验20元起,更多上云必备产品低至1元