資源簡介
利用visual c++中mfc做一個漢字字符取模的軟件。漢字點陣取模,建立字庫。完整的文件工程夾。

代碼片段和文件信息
//?BINLIB.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“Font.h“
#include?“BINLIB.h“
//#include?“FontDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?BINLIB?dialog
BINLIB::BINLIB(CWnd*?pParent?/*=NULL*/)
:?CDialog(BINLIB::IDD?pParent)
{
//{{AFX_DATA_INIT(BINLIB)
m_fontsize?=?-1;
//}}AFX_DATA_INIT
}
void?BINLIB::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BINLIB)
DDX_Control(pDX?IDC_COMBO1?m_fontstyle);
DDX_Radio(pDX?IDC_RADIO1?m_fontsize);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(BINLIB?CDialog)
//{{AFX_MSG_MAP(BINLIB)
ON_WM_CANCELMODE()
ON_BN_CLICKED(IDC_SetLib?OnSetLib)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?BINLIB?message?handlers
BOOL?BINLIB::OnInitDialog()?
{
CDialog::OnInitDialog();
//?TODO:?Add?extra?initialization?here
CString?strstyle[8]={“楷體““黑體““宋體““仿宋““幼圓““隸書““方正姚體““方正舒體“};
int?i;
for(i=0;i<8;i++)
{
m_fontstyle.InsertString(istrstyle[i]);
}
m_fontstyle.SetCurSel(0);
m_fontsize=0;
????UpdateData(FALSE);
return?TRUE;??//?return?TRUE?unless?you?set?the?focus?to?a?control
??????????????//?EXCEPTION:?OCX?Property?Pages?should?return?FALSE
}
void?BINLIB::OnCancelMode()?
{
CDialog::OnCancelMode();
//?TODO:?Add?your?message?handler?code?here
}
????????
void?DrawlabTextobject(HDC?hdcUCHAR?*pixelBufferunsigned?xCoord?unsigned?yCoord?unsigned?fgColor)
{
????int?ijm;
unsigned?char?temp;
for(j=0;j<48;j++)????????//??y
{
for(i=0;i<6;i++)??????//??x
{
?????for(?m=0;m<8;m++)?
?{
?????????????????temp=pixelBuffer[j*6+i];
?if(temp>>(7-m)&1)
?{
?????????????????????SetPixel(hdcxCoord+i*8+myCoord+jfgColor);//?該函數將指定坐標處的像素設為指定的顏色
?}
?}
}
}
}
???
void?BINLIB::OnSetLib()?
{
????UpdateData(TRUE);
CClientDC?dc(this);
????int?size;//獲取點陣大小
CString?style;
??? switch(m_fontstyle.GetCurSel())
{?
???? case?0:style=“楷體“;??break;??
????case?1:style=“黑體“;?break;??
????case?2:style=“宋體“;break;
????????case?3:style=“幼圓“;break;??
case?4:style=“仿宋“;break;???
????case?5:style=“隸書“;break;?
????case?6:style=“方正姚體“;break;?
????????case?7:style=“方正舒體“;break; ?
}
switch(m_fontsize)
{?
???? case?0:size=16;break;
????case?1:size=24;break;
????case?2:size=32;break;
????????case?3:size=48;break;??
}
????
CFont?MyFont;//創建矢量字體?
MyFont.CreateFont(sizesize/200FW_BOLD000GB2312_CHARSET0000style);
/////FW_NORMAL設置字體磅數?決定字體粗細,FW_BOLD表示黑體加粗
????dc.Selectobject(&MyFont);??//選擇一對象到指定的設備環境中,該新對象替換先前的相同類型的對象
HBRUSH?hBrush=CreateSolidBrush(RGB(255255255));//準備畫刷,把屏幕刷白
dc.SetBkMode(TRANSPARENT);
????
?????UCHAR?array[48][6];
??
int?Start_X=275Start_Y=1
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6425??2012-05-21?22:49??Font\BINLIB.cpp
?????文件???????1231??2012-05-21?20:09??Font\BINLIB.h
?????文件??????29420??2012-05-21?22:50??Font\Debug\BINLIB.obj
?????文件??????????0??2012-05-21?22:50??Font\Debug\BINLIB.sbr
?????文件????3662848??2012-05-21?22:50??Font\Debug\Font.bsc
?????文件?????122954??2012-05-21?22:53??Font\Debug\Font.exe
?????文件?????280420??2012-05-21?22:53??Font\Debug\Font.ilk
?????文件??????14492??2012-05-21?18:52??Font\Debug\Font.obj
?????文件????6940748??2012-05-21?18:52??Font\Debug\Font.pch
?????文件?????435200??2012-05-21?22:53??Font\Debug\Font.pdb
?????文件???????4304??2012-05-21?22:53??Font\Debug\Font.res
?????文件??????????0??2012-05-21?18:52??Font\Debug\Font.sbr
?????文件??????57392??2012-05-21?22:26??Font\Debug\FontDlg.obj
?????文件??????????0??2012-05-21?22:26??Font\Debug\FontDlg.sbr
?????文件?????105551??2012-05-21?18:52??Font\Debug\StdAfx.obj
?????文件????1366562??2012-05-21?18:52??Font\Debug\StdAfx.sbr
?????文件?????205824??2012-05-21?22:53??Font\Debug\vc60.idb
?????文件?????372736??2012-05-21?22:50??Font\Debug\vc60.pdb
?????文件??????38020??2012-05-21?22:53??Font\Font.aps
?????文件???????3105??2012-05-21?22:53??Font\Font.clw
?????文件???????2035??2012-05-16?13:23??Font\Font.cpp
?????文件???????4248??2012-05-21?18:59??Font\Font.dsp
?????文件????????514??2012-05-16?13:23??Font\Font.dsw
?????文件???????1302??2012-05-16?13:23??Font\Font.h
?????文件??????58368??2012-05-21?22:53??Font\Font.ncb
?????文件??????49664??2012-05-21?22:53??Font\Font.opt
?????文件????????693??2012-05-21?22:53??Font\Font.plg
?????文件???????9056??2012-05-21?22:53??Font\Font.rc
?????文件??????11569??2012-05-21?22:26??Font\FontDlg.cpp
?????文件???????1681??2012-05-17?21:22??Font\FontDlg.h
............此處省略14個文件信息
- 上一篇:MFC界面 約瑟夫環
- 下一篇:利用相關系數匹配法完成左右相片的影像匹配
評論
共有 條評論