Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use imgPlot in a MFC SDI program to show image in main window

I am trying to display acquired images in the main window of my Single Document MFC application as opposed to individual display windows. I use imgPlot to achieve this. The problem seems to be the HWND that I pass to the call. I am not sure of the proper place or technique to capture this handle.
0 Kudos
Message 1 of 4
(3,978 Views)
Hello,

Have you tried looking in the IMAQ Function Reference Help? You can locate this document by navigating to Start >> Programs >> National Instruments >> Vision >> Documentation >> NI-IMAQ Function Reference. This help file contains descriptive information for each parameter of the function.

I would also suggest taking a look at the IMAQ examples that shipped with NI-IMAQ. You can find the C examples in the following directory:
C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVC

I would suggest starting with the HL Snap example. That is a very simple example that snaps a single image and displays it.

Take a look at that documentation and at those examples and let me know if you have any additional questions.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,965 Views)
I have gone through the examples. I actually have a working application that uses a good portion of the capabilities. For some odd reason though, I have never been able to get this to work. I think its how or when I go about getting the m_hwnd or it may be a painting issue. I do not get any errors from the imgPlot though.
0 Kudos
Message 3 of 4
(3,960 Views)
Hello,

Could you give me more detail as to how you are obtaining the handle? Are you using the CreateWindow() function? This function should return a handle to the window that is generated. This should be usable for the window input of imgPlot(). CreateWindow is a Windows Management function that should be available in Visual Studio, so information about using that function should be available in the Visual Studio help files.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,923 Views)