Displaying The Captured Images (Visual C++ 5.0 and later)

1.

Start with the project you created in Capturing Multiple Images

2.

Add code to handle the CaptureHotKeyPressed Event.

 

a.

Add the following code to RasterScrSink.cpp immediately before the END_DISPATCH_MAP() macro. The VT_EMPTY argument indicates that the CaptureImage Event has no return value. The VTS_NONE argument indicates that the CaptureHotKeyPressed Event has no argument:

   DISP_FUNCTION_ID(CRasterScrSink, "CaptureHotKeyPressed",  2, OnCaptureHotKeyPressed, VT_EMPTY, VTS_NONE)

 

b.

Click on the Class View tab in the project workspace.

 

c.

Right-click the "CRasterScrSink" branch, and choose Add Member Function.

 

d.

For Function Type enter void.

 

e.

For Function Declaration enter the following and click the OK button:

OnCaptureHotKeyPressed()

 

f.

Code the OnCaptureHotKeyPressed() method as follows:

void CRasterScrSink::OnCaptureHotKeyPressed ()
{
   int ret;
   
   ret = ::MessageBox(NULL, TEXT("Do you want to capture?"), TEXT("Capture Key Pressed"), MB_YESNO);
   if (ret == IDNO)
      if(m_pDlg->m_pLEADRasterScr->IsCaptureActive ())
         /*cancel the capture*/
         m_pDlg->m_pLEADRasterScr->StopCapture ();
}

3

On the main menu, select Build> Build ScrCap.exe to build the project

4

On the main menu, select Build> Execute ScrCap.exe to run the project. Click on "Capture Multi", press F11, and then select the window(s) you wish to capture, at the proper times. To view the images you captured, click on the Display command button after capturing has ended.