⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fusheview.cpp

📁 雷达资料的处理和应用
💻 CPP
字号:
// FuSheView.cpp : implementation of the CFuSheView class
//

#include "stdafx.h"
#include "FuShe.h"
#include "MainFrm.h"

#include "FuSheDoc.h"
#include "FuSheView.h"
#include "math.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFuSheView

IMPLEMENT_DYNCREATE(CFuSheView, CView)

BEGIN_MESSAGE_MAP(CFuSheView, CView)
	//{{AFX_MSG_MAP(CFuSheView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFuSheView construction/destruction

CFuSheView::CFuSheView()
{
	// TODO: add construction code here
//	GetClientRect(&rect);
	bStar=TRUE;
}

CFuSheView::~CFuSheView()
{
	
}

BOOL CFuSheView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CFuSheView drawing

void CFuSheView::OnDraw(CDC* pDC)
{
	CFuSheDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if(bStar)
	{
		CDC memDC;
		CRect rect;
		CRect rect1;
		GetClientRect(&rect);
		memDC.CreateCompatibleDC(pDC);
		CBitmap bmp;
		if(!(bmp.LoadBitmap(IDB_BITMAP1)))
			return;
		BITMAP bm;
		bmp.GetObject(sizeof(BITMAP),&bm);

//		bmp.
		CBitmap * oldbmp=(CBitmap*)memDC.SelectObject(&bmp);
		pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
		memDC.SelectObject(oldbmp);
		memDC.DeleteDC();
	}
	else
	{
		CMainFrame * pMain=(CMainFrame*)AfxGetMainWnd();
		if(pMain->flag==1)                                   ////强度场
		{
			CString ss=pMain->m_pQDFileName;
			CFile file1;
			file1.Open(ss,CFile::modeRead);
		
			CRect rect;
			GetClientRect(&rect);
			pDC->PatBlt(0,0,rect.right,rect.bottom-140,WHITENESS);
			m_Pic.GetDbzData(&file1,(CDC*)pDC);
		}
		else if(pMain->flag==2)
		{
			CString ss=pMain->m_pQDFileName;
			CFile file1;
			file1.Open(ss,CFile::modeRead);
		
			CRect rect;
			GetClientRect(&rect);
			pDC->PatBlt(0,0,rect.right,rect.bottom-140,WHITENESS);
			m_Pic.GetVolData(&file1,(CDC*)pDC);
		}
		else if(pMain->flag==3)
		{
			CString ss=pMain->m_pFileName;
			CFile file1;
			file1.Open(ss,CFile::modeRead);
		
			CRect rect;
			GetClientRect(&rect);
			pDC->PatBlt(0,0,rect.right,rect.bottom-140,WHITENESS);
			m_Pic.GetDealiasedData(&file1,(CDC*)pDC);
		}

	}
	
	
	
}

/////////////////////////////////////////////////////////////////////////////
// CFuSheView printing

BOOL CFuSheView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CFuSheView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CFuSheView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CFuSheView diagnostics

#ifdef _DEBUG
void CFuSheView::AssertValid() const
{
	CView::AssertValid();
}

void CFuSheView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CFuSheDoc* CFuSheView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFuSheDoc)));
	return (CFuSheDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CFuSheView message handlers

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -