//////////////////////////////TWAIN Specific////////////////////////////////////////
void CFPAnalysisView::OnFileScan() 
{
	
    CFPAnalysisDoc* pDoc = GetDocument();

   	CScanDlg dlg;
	if (dlg.DoModal() == IDOK)
	{
		currentimage.SetFilename(dlg.m_szImageName);
		currentimage.LoadBMP();
		Invalidate(FALSE);
		pDoc->SetTitle(dlg.m_szImageName);
	}

	//set the size of view to image-size...
	  CChildFrame* pParent =(CChildFrame*)GetParentFrame();
	  CRect rcParent;

	  rcParent.left = 0;
	  rcParent.top =0;
	  rcParent.right = (int)currentimage.GetWidth();
	  rcParent.bottom = (int)currentimage.GetHeight();
	  pParent->MoveWindow(&rcParent);

	  
	  SetFPScrollInfo();

      // Refresh the entire view...
	  Invalidate(TRUE);	
}
示例#2
0
文件: Scan.cpp 项目: DjPasco/Mag
BOOL CScanApp::InitInstance()
{
    if (!AfxSocketInit())
    {
        AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
        return FALSE;
    }

    // Standard initialization

#ifdef _AFXDLL
    Enable3dControls();			// Call this when using MFC in a shared DLL
#else
    Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

    CScanDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    }
    else if (nResponse == IDCANCEL)
    {
    }

    // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
}