#include <windows.h>
#include <cvirte.h>
#include <userint.h>
#include <ansi_c.h>
#include "mil.h"
#include <utility.h>
#include "nivision.h"
#include "video_test.h"
#define Image_X 768
#define Image_Y 576
#define WINDOW_TO_USE 0
static int panelHandle;
static int ImaqHandle; // will contain the handle to the imaq window
static int windHandle; // will contain the handle to the CVI window
Image *image;
unsigned char myArray[Image_Y][Image_X];
int windowHandle,disp,x,y;
Point position;
MIL_ID MilApplication, /* Application identifier. */
MilSystem, /* System identifier. */
MilDisplay, /* Display identifier. */
MilDigitizer, /* Digitizer identifier. */
MilImage; /* Image buffer identifier. */
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "video_test.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle); //显示面板
imaqSetupWindow(WINDOW_TO_USE,0);//设置窗口的性质;窗口号,定义窗口的行为 //imaqSetWindowPalette(WINDOW_TO_USE,2,NULL,0);
position.x=1;position.y=1;
imaqMoveWindow(WINDOW_TO_USE,position);//移动图像窗口,窗口号,窗口左上角的位置
image = imaqCreateImage (IMAQ_IMAGE_U8, 0);//创建一个图像
/*set the image window to be one part of the CVI window*/ //设置图像窗口的CVI窗口 windHandle = (int) FindWindow (NULL, "Video Test"); // get CVI window handle
ImaqHandle = (int) imaqGetSystemWindowHandle(0); //返回一个窗口句柄