📄 drawbmp.cpp
字号:
// DrawBmp.cpp : implementation file
//
#include "stdafx.h"
#include "DrawBmp.h"
#include ".\drawbmp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DrawBmp
DrawBmp::DrawBmp()
{
}
DrawBmp::~DrawBmp()
{
}
BEGIN_MESSAGE_MAP(DrawBmp, CStatic)
//{{AFX_MSG_MAP(DrawBmp)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DrawBmp message handlers
void DrawBmp::ReDraw()
{
m_dib.LoadImg(m_image,m_dib.m_lpBMIH->biBitCount/8);
CDC *dc=this->GetDC();
CPoint point(0,0);
CSize size;
size.cx=m_image.m_Width;
size.cy=m_image.m_Height;
m_dib.Draw(dc,point,size);
// Invalidate();
}
void DrawBmp::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CPoint point=0;
CSize size;
size.cx=m_image.m_Width;
size.cy=m_image.m_Height;
if(m_image.m_ImageBody.GetSize())
{
ReDraw();
m_dib.Draw(&dc,point,size);
}
// Do not call CStatic::OnPaint() for painting messages
}
void DrawBmp::RGB2YUV()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -