📄 jpegqualitytestview.cpp
字号:
// JpegQualityTestView.cpp : implementation of the CJpegQualityTestView class
//
#include "stdafx.h"
#include "JpegQualityTest.h"
#include "JpegQualityTestDoc.h"
#include "JpegQualityTestView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CJpegQualityTestView
IMPLEMENT_DYNCREATE(CJpegQualityTestView, CScrollView)
BEGIN_MESSAGE_MAP(CJpegQualityTestView, CScrollView)
//{{AFX_MSG_MAP(CJpegQualityTestView)
// 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
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CJpegQualityTestView construction/destruction
CJpegQualityTestView::CJpegQualityTestView()
{
// TODO: add construction code here
}
CJpegQualityTestView::~CJpegQualityTestView()
{
}
BOOL CJpegQualityTestView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CJpegQualityTestView drawing
void CJpegQualityTestView::OnDraw(CDC* pDC)
{
CJpegQualityTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (pDoc->m_bmInfo.bmiHeader.biWidth>0 && pDoc->m_bmInfo.bmiHeader.biHeight>0){
::SetDIBitsToDevice(pDC->m_hDC,
0,
0,
pDoc->m_bmInfo.bmiHeader.biWidth,
pDoc->m_bmInfo.bmiHeader.biHeight,
0,
0,
0,
pDoc->m_bmInfo.bmiHeader.biHeight,
pDoc->m_pBmp+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER),
&pDoc->m_bmInfo,
DIB_RGB_COLORS);
}
}
void CJpegQualityTestView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CJpegQualityTestDoc* pDoc=GetDocument();
ASSERT_VALID(pDoc);
SetScrollSizes(MM_TEXT,CSize(pDoc->m_bmInfo.bmiHeader.biWidth,pDoc->m_bmInfo.bmiHeader.biHeight));
}
/////////////////////////////////////////////////////////////////////////////
// CJpegQualityTestView diagnostics
#ifdef _DEBUG
void CJpegQualityTestView::AssertValid() const
{
CScrollView::AssertValid();
}
void CJpegQualityTestView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
CJpegQualityTestDoc* CJpegQualityTestView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CJpegQualityTestDoc)));
return (CJpegQualityTestDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CJpegQualityTestView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -