1 Star 0 Fork 81

xxcharles/FontMaker

forked from jiangxiaogang/FontMaker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
PreviewWnd.cpp 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
jiangxiaogang 提交于 2018-07-31 17:00 . 支持生成变宽字库
// PreviewWnd.cpp : ʵļ
#include "stdafx.h"
#include "FontMakerApp.h"
#include "PreviewWnd.h"
// CPreviewWnd
IMPLEMENT_DYNAMIC(CPreviewWnd, CWnd)
BEGIN_MESSAGE_MAP(CPreviewWnd, CWnd)
ON_WM_PAINT()
ON_WM_DESTROY()
END_MESSAGE_MAP()
void CPreviewWnd::SetDC(HDC hdc)
{
m_dc.Attach(hdc);
}
void CPreviewWnd::SetSize(INT width, INT height)
{
RECT rc;
GetClientRect(&rc);
m_nWidth = width;
m_nHeight = height;
m_nPaintX = (rc.right-m_nWidth)/2;
m_nPaintY = (rc.bottom-m_nHeight)/2;
}
// CPreviewWnd Ϣ
void CPreviewWnd::OnPaint()
{
CBrush br;
CRgn rgn;
CPaintDC dc(this);
rgn.CreateRectRgnIndirect(&m_client);
br.CreateSysColorBrush(COLOR_BTNFACE);
dc.SelectClipRgn(&rgn);
dc.FillRect(&m_client,&br);
dc.BitBlt(m_nPaintX,m_nPaintY,m_nWidth,m_nHeight,&m_dc,0,0,SRCCOPY);
br.DeleteObject();
rgn.DeleteObject();
}
void CPreviewWnd::PreSubclassWindow()
{
m_nWidth = 0;
m_nHeight = 0;
m_nPaintX = 0;
m_nPaintY = 0;
GetClientRect(&m_client);
CWnd::PreSubclassWindow();
}
void CPreviewWnd::OnDestroy()
{
CWnd::OnDestroy();
m_dc.Detach();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/xxcharles/FontMaker.git
[email protected]:xxcharles/FontMaker.git
xxcharles
FontMaker
FontMaker
master

搜索帮助