LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Event

hi everybody,
i'd like to display images from a array of images in seperate windows...
to control the events i use imaqGetLastEvent()...but the problem is, that all windows get closed when i try to close one window AND
the refreshing of an newly activated window does not work.

here my display function:
 
void DisplayResults(Image** image, int camCount)
{
   
   int cc=camCount;
   int winNum;
   WindowEventType event;

   for(int z=0;z<cc;z++)
   {
       imaqDisplayImage (image[z], z, TRUE);
   }

 /*
  * check events while event!=IMAQ_CLOSE_EVENT
  * AND the image array is not empty
  */
 do
   {
       imaqGetLastEvent(&event, &winNum, NULL, NULL);
      // close the specific window
       if(event==IMAQ_CLOSE_EVENT)
       {
           imaqCloseWindow(winNum);
       }
       // bring activated window to front and refresh it
       if(event==IMAQ_ACTIVATE_EVENT)
       {
           imaqBringWindowToTop(winNum);
           imaqDisplayImage (image[winNum], winNum, TRUE);
       }
   }
   while(event !=IMAQ_CLOSE_EVENT && image !=NULL);

does anybody has an idea for me?
best regards,
malte
0 Kudos
Message 1 of 3
(3,131 Views)

Option1:  Try adding ProseccSystemEvents() or ProcessDrawEvents()  within the do while() loop.

Option2:  Get rid of the do while() loop.  Cut and paste the code within the loop into a call back function referenced by the Image window UIR.

 

robskii

 

 

0 Kudos
Message 2 of 3
(3,113 Views)
hi robskii,
thanks for your answer...but i haven't got cvi...i'm only using the vision functions and vc++ 6.0.
best regards,
malte
0 Kudos
Message 3 of 3
(3,094 Views)