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

📄 exampl~3.cpp

📁 vc++net很不错的一个工具
💻 CPP
字号:
// Example012View.cpp : CExample012View 类的实现
//
#include "stdafx.h"
#include "Example012.h"
#include "Example012Doc.h"
#include "Example012View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CExample012View
IMPLEMENT_DYNCREATE(CExample012View, CView)
BEGIN_MESSAGE_MAP(CExample012View, CView)
END_MESSAGE_MAP()

// CExample012View 构造/销毁
CExample012View::CExample012View()
{
	// TODO: 在此处添加构造代码
}

CExample012View::~CExample012View()
{
}

BOOL CExample012View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
	// 样式
	return CView::PreCreateWindow(cs);
}

// CExample012View 绘制
void CExample012View::OnDraw(CDC* pDC)
{
	CExample012Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: 在此处为本机数据添加绘制代码
	using namespace Gdiplus;
	Graphics graphics(pDC->m_hDC);
	Image image(L"Test.bmp");
	int width = image.GetWidth();
	int height = image.GetHeight();
	graphics.DrawImage(&image, 10, 10, width/2, height);
	ColorMap colorMap[1];
	colorMap[0].oldColor = Color(255, 0, 255, 0); 
	colorMap[0].newColor = Color(255, 0, 0, 0); 
	ImageAttributes  imageAttributes ;
	imageAttributes.SetRemapTable(1, colorMap, ColorAdjustTypeBitmap);
	graphics.DrawImage(&image, Rect(150, 10, width/2, height),
						0, 0,width,height,UnitPixel,&imageAttributes);		
}

// CExample012View 诊断
#ifdef _DEBUG
CExample012Doc* CExample012View::GetDocument() const // 非调试版本是内联的
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CExample012Doc)));
	return (CExample012Doc*)m_pDocument;
}
#endif //_DEBUG

⌨️ 快捷键说明

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