关于CVI求教啊!哀求~
怎么调用彩色图像搞得不明白,哪位仁兄能告知一二啊!不胜感谢啊!
好像它有个GetBitmapFromFile命令吧,返回一个id,然后可以用CanvasDrawBitmap命令
具体我没试过,只是刚急忙查了一下它的帮助文件,估计可以实现,你先试试,
我也看看
我刚试了一下,是可以实现的,回调函数如下
int CVICALLBACK load_image (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{ char path[MAX_PATHNAME_LEN ];
int bitmap;
switch (event)
{
case EVENT_COMMIT:
if (FileSelectPopup ("", "*.bmp", "", "选择", VAL_LOAD_BUTTON, 0, 0, 1, 0,
path)>0)
{ GetBitmapFromFile (path, &bitmap);
CanvasClear (mainpanel, PANEL_CANVAS, VAL_ENTIRE_OBJECT);
CanvasDrawBitmap (mainpanel, PANEL_CANVAS, bitmap, VAL_ENTIRE_OBJECT,
VAL_ENTIRE_OBJECT);
}
break;
}
return 0;
}