Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Dock image window to UIR


In IMAQ or the VDS, is there a way to programmatically
dock the image window to a main UIR? 
0 Kudos
Message 1 of 2
(3,244 Views)

Yes there is:

 

Check out my general purpose function below. hPARENTPanel is the UIR panel to dock to.

 

// UIInitImaqWindow
void UIInitImaqWindow(int *Window,char *Title,int l,int t,int w,int h)
{
 const RGBValue c={255,255,0,0};
 Point p;
 int imaqHandle;
 
 if(*Window==-1)
 {
  // Set IMAQ Window Parent
  if(imaqGetWindowHandle(Window)!=0)  
  {
   imaqHandle=(int)imaqGetSystemWindowHandle(*Window);
   SetParent((HWND)imaqHandle,(HWND)hPARENTPanel);
  }
  
  imaqSetWindowBackground(*Window,IMAQ_FILL_STYLE_SOLID,IMAQ_HATCH_STYLE_HORIZONTAL,&c,&c);
 }

    // IMAQ_WIND_CLOSEABLE
    // IMAQ_WIND_TOPMOST
 
 // Setup IMAQ Window
 if((Title!=NULL)&&(strlen(Title)>0))  
 {
  imaqSetWindowTitle(*Window,Title);
  imaqSetupWindow(*Window,IMAQ_WIND_RESIZABLE|IMAQ_WIND_TITLEBAR);
 }              
 else
  imaqSetupWindow(*Window,0);
  
 p=imaqMakePoint(l,t);
 imaqMoveWindow(*Window,p); // Move IMAQ Window
 imaqSetWindowSize(*Window,w,h); // Set IMAQ Window Size
}

 

0 Kudos
Message 2 of 2
(3,225 Views)