📄 pen.cpp
字号:
// ============================================================================
// Pen implementation
//
// (c) 2003 Ken Reed
//
// This is free software. You can redistribute it and/or modify it under the
// terms of the GNU General Public License version 2 as published by the Free
// Software Foundation.
// ============================================================================
#include "stdafx.h"
#include "pen.h"
#include <assert.h>
// ============================================================================
// Construction
// ============================================================================
Pen::Pen(HDC hdc, COLORREF colour, int width)
{
shdc = hdc;
pen = CreatePen(PS_SOLID, width, colour);
assert(pen != 0);
SelectObject(hdc, pen);
}
// ============================================================================
// Destruction
// ============================================================================
Pen::~Pen()
{
SelectObject(shdc, old_pen);
DeleteObject(pen);
}
// ============================================================================
// Convert to HPEN
// ============================================================================
Pen::operator HPEN() const
{
return pen;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -