ShowInfoDlg.cpp
上传用户:lhhslc
上传日期:2022-08-07
资源大小:5190k
文件大小:2k
- // ShowInfoDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ForShowInfoDialog.h"
- #include "ShowInfoDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CShowInfoDlg dialog
- CShowInfoDlg::CShowInfoDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CShowInfoDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CShowInfoDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CShowInfoDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CShowInfoDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CShowInfoDlg, CDialog)
- //{{AFX_MSG_MAP(CShowInfoDlg)
- ON_WM_LBUTTONDOWN()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CShowInfoDlg message handlers
- BOOL CShowInfoDlg::Start()
- {
- return TRUE;
- }
- BOOL CShowInfoDlg::Stop()
- {
- this->DestroyWindow();
- return TRUE;
- }
- BOOL CShowInfoDlg::ShowImage(CString strImagePath,int nSX,int nSY,int nEX,int nEY,int IMG_TYPE)
- {
- CClientDC mDC(this);
-
- CDC mTempDC;
-
- mTempDC.CreateCompatibleDC(&mDC);
- //AfxMessageBox("AAAAAAAA");
- if(mTempDC==NULL)
- {
- strErrorMsg.Format("CreateDC Fail %d",::GetLastError());
- return FALSE;
- }
-
- CBitmap mBitmap;
- BITMAP bmpInfo;
- int nRet=mBitmap.LoadBitmap(IDB_BITMAP1);
- if(nRet==0)
- {
- strErrorMsg.Format("LoadBitmap Fail %d",::GetLastError());
- return FALSE;
- }
- mBitmap.GetBitmap(&bmpInfo);
- mTempDC.SelectObject(&mBitmap);
- ::StretchBlt(mDC.GetSafeHdc(),nSX,nSY,nEX,nEY,mTempDC.GetSafeHdc(),0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,SRCCOPY);
- mTempDC.DeleteDC();
- mBitmap.DeleteObject();
-
- CRect rect(nSX,nSY,nEX,nEY);
- return TRUE;
- }
- BOOL CShowInfoDlg::ShowMsg(CString strMsg,int nSX,int nSY)
- {
-
-
- return TRUE;
- }
- void CShowInfoDlg::OnLButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- this->DestroyWindow();
- CDialog::OnLButtonDown(nFlags, point);
- }