📄 utility.cpp
字号:
//
#include "stdafx.h"
CString CUtility ::GenerateID()
{
CString strID;
SYSTEMTIME sysTime;
::GetSystemTime(&sysTime);
DWORD dwTickCount = ::GetTickCount();
DWORD dwRandom = rand();
strID.Format(_T("%04d%02d%02d%d%d"), sysTime.wYear, sysTime.wMonth, sysTime.wDay, dwTickCount, dwRandom);
return strID;
}
// 把DC的映射模式设置为0.01mm的模式
void CUtility::PrepareDC(HDC hdc, float fZoomScale)
{
::SetMapMode(hdc,MM_ISOTROPIC);
int XLogMm = ::GetDeviceCaps(hdc, HORZSIZE);
int YLogMm = ::GetDeviceCaps(hdc, VERTSIZE);
int XLogPix = ::GetDeviceCaps(hdc, HORZRES);
int YLogPix = ::GetDeviceCaps(hdc, VERTRES);
::SetWindowExtEx(hdc,XLogMm*100,YLogMm*100,NULL);
::SetViewportExtEx(hdc,(int)(XLogPix*fZoomScale), (int)(YLogPix*fZoomScale),NULL);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -