Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

screen flicker

I am using MSVC++ to implement an image processing application. I am trying to implement the equivalent of the 'HLRing' application from the NI example directory, except I want to use the CWIMAQ and cwimaqviewer libaries. I can capture and display the images continuously, but the display flickers really badly. Does anyone know how to keep the display from flickering?
0 Kudos
Message 1 of 5
(3,627 Views)
Does the flicker occur as a result of running the software? or as a result of moving it to a new location near instruments? Power supplies are notorious for making the screen flicker.

So what I am asking is if the flicker results from the environment or from displaying the capture in software.

JLV
Message 2 of 5
(3,616 Views)
It is definately from displaying the capture in the software because MAX doesn't flicker.
0 Kudos
Message 3 of 5
(3,611 Views)
mps -

There are a few known issues with flickering in the CWIMAQViewer that should be fixed soon, but there are workarounds. In your HLRing example, are you calling CWIMAQViewer.Attach every time a new image is acquired? If so, try copying the new image into a separate image (perhaps CWIMAQViewer.Image - I'm not sure how easy this is to do in C++) and only calling CWIMAQViewer.Attach once. That should clear up any flickering issues.

Let me know how this works out for you.

Greg Stoll
IMAQ R & D
National Instruments
Greg Stoll
LabVIEW R&D
Message 4 of 5
(3,597 Views)
Thanks for your help -- it worked!

It's actually pretty easy to implement in C++.

void CImageDisplay::DisplayImage(LPDISPATCH image)
{
//m_image is a private member of CImageDisplay and is initialized to NULL in OnInitDialog

if(m_image==NULL)//initialize m_image to NULL in constructor or OnInitDialog...
{
m_image=image;
m_cViewer.Attach(m_image);//attach is a member of CCWIMAQViewer
}
else
{
m_image=image;
m_cViewer.Refresh();//Refresh is a member of CCWIMAQViewer
}
}
0 Kudos
Message 5 of 5
(3,566 Views)