字模软件增加函数注释 加HEX空格 next Serial

// FONTDlg.cpp : implementation file
/*2014 5 2 16:23增加函数注释*********************/
#include "stdafx.h"
#include "FONT.h"
#include "FONTDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/
// CAboutDlg dialog used for App About
/*1**********************************************/ 
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
    // Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA


// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/*2**********************************************/ 
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
/*3**********************************************/ 
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
/*4**********************************************/ 
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/
// CFONTDlg dialog
/*5**********************************************/ 
CFONTDlg::CFONTDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFONTDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFONTDlg)
m_ZiInput = _T("");
m_FontHeight = _T("16");
    m_ZiInput = _T("佳");
m_Movx = 0;
m_Movy = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
    m_Movy = m_Movx = 0;
}
/*6**********************************************/ 
void CFONTDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFONTDlg)
DDX_Control(pDX, IDC_EDIT5, m_Edit5);
DDX_Control(pDX, IDC_COMBO2, m_ModeCBox);
DDX_Control(pDX, IDC_COMBO1, m_CBox);
DDX_Control(pDX, IDC_EDIT1, m_Edit);
DDX_Text(pDX, IDC_EDIT1, m_ZiInput);
DDX_CBString(pDX, IDC_COMBO1, m_FontHeight);
DDX_Text(pDX, IDC_EDIT3, m_Movx);
DDX_Text(pDX, IDC_EDIT4, m_Movy);
//}}AFX_DATA_MAP
}
/*7**********************************************/ 
BEGIN_MESSAGE_MAP(CFONTDlg, CDialog)
//{{AFX_MSG_MAP(CFONTDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
ON_EN_CHANGE(IDC_EDIT3, OnChangeEdit3)
ON_EN_CHANGE(IDC_EDIT4, OnChangeEdit4)
ON_CBN_EDITCHANGE(IDC_COMBO1, OnEditchangeCombo1)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/
// CFONTDlg message handlers
/*8**********************************************/ 
BOOL CFONTDlg::OnInitDialog()
{
CString str;
str.LoadString(IDR_MAINFRAME);
SetWindowText(str);
    CDialog::OnInitDialog();
    SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
GetFont()->GetLogFont(&lf);
m_ModeCBox.SetCurSel(0);
    return TRUE;  // return TRUE  unless you set the focus to a control
}
/*9**********************************************/ 
void CFONTDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
/*10**********************************************/ 
void CFONTDlg::OnPaint() 
{
    CPaintDC dc(this); // device context for painting
UpdateFont(&dc);
}
/*11**********************************************/ 
HCURSOR CFONTDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
/*12**********************************************/ 
void CFONTDlg::OnButton1() 
{
CFontDialog dlg(&lf);
if(dlg.DoModal() == IDOK)
{
dlg.GetCurrentFont(&lf);
HFONT hfont = ::CreateFontIndirect(&lf);  
Invalidate();
m_FontHeight.Format("%d",abs(lf.lfHeight));
m_CBox.SetWindowText(m_FontHeight);
}
}
/*13**********************************************/ 
void CFONTDlg::OnButton2() 
{
CDC       MemDC;   //首先定义一个显示设备对象 
CBitmap   MemBitmap;//定义一个位图对象 
CClientDC dc(this);
    MemDC.CreateCompatibleDC(NULL); 
MemBitmap.CreateCompatibleBitmap(&dc, 100, 100); 
CBitmap   *pOldBit=MemDC.SelectObject(&MemBitmap); 
    HFONT hfont = ::CreateFontIndirect(&lf);
CFont* pfont = CFont::FromHandle(hfont);
CFont* def_font = MemDC.SelectObject(pfont);
BYTE i,j;
CString str;
char strdc[4]={0};
int height = abs( lf.lfHeight );
    str.Format("hz%d%s.c", height, lf.lfFaceName);
CFile f( str, CFile::modeCreate | CFile::modeWrite );
CArchive ar(&f, CArchive::store);
str.Format( "/*中文字库 %s font%d.c*/\r\n"
"#include <font_mac.h>\r\n"
"const char hz%d[] = {\r\n"
,lf.lfFaceName
, height, height);
       for(i=0; i<str.GetLength(); i++)
ar<<str.GetAt(i);
for(i=0xA1; i<0xF8; i++)
{
strdc[0] = i;
for(j=0xA1; j<0xFF; j++)
{
ar << '\t';
ar << '/' << '/';
ar <<i<<j;
ar << '\r' << '\n';
strdc[1] = j;
MemDC.FillSolidRect(0, 0, 100, 100, RGB(255,255,255));
MemDC.TextOut(0, 0, strdc, 2);
GetFontToFile(&MemDC, ar, height, height );
}
}
ar << '}';
ar << '\r' << '\n';
ar.Close();
f.Close();
    ::DeleteObject(hfont);
    MemBitmap.DeleteObject(); 
MemDC.DeleteDC(); 
}
/*14**********************************************/ 
void CFONTDlg::OnButton3() //ok
{
CDC       MemDC;   //首先定义一个显示设备对象 
CBitmap   MemBitmap;//定义一个位图对象 
CClientDC dc(this);
MemDC.CreateCompatibleDC(NULL); 
MemBitmap.CreateCompatibleBitmap(&dc, 100, 100); 
    CBitmap   *pOldBit=MemDC.SelectObject(&MemBitmap); 
HFONT hfont = ::CreateFontIndirect(&lf);
CFont* pfont = CFont::FromHandle(hfont);
CFont* def_font = MemDC.SelectObject(pfont);
int height = abs( lf.lfHeight );
int width;
BYTE c;
int i;
CString str;
str.Format("font%dAssic%s.c", height, lf.lfFaceName);
CFile f( str, CFile::modeCreate | CFile::modeWrite );
CArchive ar(&f, CArchive::store);
TRACE(lf.lfFaceName);
str.Format( "/*ASSIC %s font%d.c*/\r\n"
"#include <font_mac.h>\r\n"
"const char font%d[] = {\r\n"
,lf.lfFaceName
, height, height);
for(i=0; i<str.GetLength(); i++)
ar<<str.GetAt(i);
for(c=0x20; c<127; c++)
{
ar << '\t';
ar << '/' << '/';
str.Format("%c", c);
ar << c;
ar << '\r' << '\n';
MemDC.FillSolidRect(0, 0, height, height, RGB(255,255,255));
MemDC.TextOut(0, 0, str, str.GetLength());
width = height/2;
GetFontToFile(&MemDC, ar, width, height );
ar << '\r' << '\n';
}
ar << '}';
ar << '\r' << '\n';
ar.Close();
f.Close();
MemDC.SelectObject(def_font);
::DeleteObject(hfont);
MemBitmap.DeleteObject(); 
MemDC.DeleteDC();
}
/*CreateCompatibleDC现有设备上下文环境的句柄,如果该句柄为NULL.*/
/*该函数创建一个与应用程序的当前显示器兼容的内存设备上下文环境*/
/*CreateCompatibleBitmap该函数创建与指定设备环境相关兼容的位图*/
/*函数原型HBITMAP CreateCompatibleBitmap(HDC hdc,int nWidth,int
 nHeight)**hdc设备环境句柄.nWidth:指定位图的宽度,单位为像素.
nHeight:指定位图的高度,单位为像素。如果函数执行成功,那么返回值
是位图的句柄;如果函数执行失败,那么返回值为NULL。若想获取更多
错误信息,请调用GetLastError。*/
/*CreateFontIndirect该函数创建一种在指定结构定义其特性的逻辑字体。
这种字体可在后面的应用中被任何设备环境选作字体。
函数原型:HFONT CreateFontIndirect(CONST LOGFONT *lplf);
参数:lplf:指向定义此逻辑字体特性的LOGFONT结构的指针。返回值:
如果函数调用成功,返回值是逻辑字体的句柄;如果函数调用失败,返回值是NULL.*/
/**/
/**/
/**/
/*15**************转换****************************/ 
void CFONTDlg::OnButton4()//ok 
{
UpdateData();                                     //更新编辑框
CString str;                                      //字符串对象str
CString out;                                      //字符串对象out
CDC       MemDC;                                  //首先定义一个显示设备对象 MemDC
CBitmap   MemBitmap;                              //定义一个位图对象 MemBitmap
CClientDC  dc(this);                              //获取当前的绘制设备(如:窗口,打印机)句柄
    MemDC.CreateCompatibleDC(NULL);                   //函数创建一个与应用程序当前显示器兼容的内存设备上下文环境
    MemBitmap.CreateCompatibleBitmap(&dc,100,100);    //创建与指定设备环境相关兼容的位图
    CBitmap   *pOldBit=MemDC.SelectObject(&MemBitmap);//在MemDC上画一个位图
HFONT hfont=::CreateFontIndirect(&lf);            //创建一种在指定结构定义其特性的逻辑字体
CFont* pfont=CFont::FromHandle(hfont);            //
CFont* def_font=MemDC.SelectObject(pfont);        //选择新字体
int i;                                            //
str="";                                           //
out="";                                           //
for(i=0; i<m_ZiInput.GetLength();)                //获得字节数
{                                                 //
WCHAR ch=m_ZiInput.GetAt(i++)&0xFF;           //函数返回值当前索引下所对应的数组元素
if(ch>0xA0)                                   //1010 0000 128+32=160
{                                             //
ch+=m_ZiInput.GetAt(i++)<<8;              //当前索引下所对应的数组元素
}                                             //
switch(m_ModeCBox.GetCurSel())                //
{                                             //
case 0:                                       //
TCharToZi(&MemDC,ch,str);                 //横向取模
break;                                    //
case 1:                                       //
TCharToZiH(&MemDC,ch,str);                //纵向取模
break;                                    //
}                                             //
out+=str;                                     //
}                                                 //
    SetDlgItemText(IDC_EDIT2, out );                  //
    MemDC.SelectObject(def_font);                  //
// Done with the font. Delete the font object.
::DeleteObject(hfont);                            //绘图完成后的清理 
MemBitmap.DeleteObject(); 
MemDC.DeleteDC();
}
/*16**********************************************/ 
void CFONTDlg::OnButton5() //ok
{
    int i,j,c;
CString str = "font_mac.h";
CString out;
CFile f( str, CFile::modeCreate | CFile::modeWrite );
str = "/*font_mac.h*/\r\n" 
"#ifndef __FONT_MAC_H__\r\n"
"#define __FONT_MAC_H__\r\n"
"\r\n\r\n";
f.Write(str.GetBuffer(0), str.GetLength());
for(i=0; i<256; i++)
{
str = "#define ";
c = 1;
for(j=0; j<8; j++)

if( i & c)
{
str += "X";
}else 
str += "_";
c<<=1;
}
out.Format(" \t0x%02X\r\n", i );           //
str += out;                                    //
f.Write(str.GetBuffer(0), str.GetLength());    //
}                                                  //
str = "\r\n\r\n#endif /*__FONT_MAC_H__*/\r\n";     //
f.Write(str.GetBuffer(0), str.GetLength());        //
f.Close();                                       //
}
/*17**********************************************/ 
void CFONTDlg::OnChangeEdit1() 
{
Invalidate();
}
/*18**********************************************/ 
void CFONTDlg::OnChangeEdit3() 
{
 Invalidate();
}
/*19**********************************************/ 
void CFONTDlg::OnChangeEdit4() 
{
Invalidate();
}
/*20**********************************************/ 
void CFONTDlg::OnEditchangeCombo1() 
{
UpdateData(TRUE);
lf.lfHeight = -atoi(m_FontHeight);
Invalidate();
}
/*21**********************************************/ 
int CFONTDlg::ColorToBool(COLORREF color)
{
int ret;
ret=GetRValue(color)*30 + GetGValue(color)*59+GetBValue(color)*11;
ret/=100;
return ret;
}
/*22**********************************************/ 
void CFONTDlg::DisFont()//ok
{
    CDC       MemDC;   //首先定义一个显示设备对象 
CBitmap   MemBitmap;//定义一个位图对象 
int height=abs(lf.lfHeight);
CClientDC dc(this);
    MemDC.CreateCompatibleDC(NULL); 
    MemBitmap.CreateCompatibleBitmap(&dc, 100, 100); 
    CBitmap   *pOldBit=MemDC.SelectObject(&MemBitmap); 
    HFONT hfont = ::CreateFontIndirect(&lf);
CFont* pfont = CFont::FromHandle(hfont);
    CFont* def_font = MemDC.SelectObject(pfont);
CString str;
m_Edit.GetWindowText(str);
MemDC.FillSolidRect(0,0,height,height,RGB(255,255,255));
MemDC.TextOut(0,0,str,str.GetLength());
    MemDC.SelectObject(def_font);
    int i,j;
int x,y;
CRect rect;
GetClientRect(&rect);
y=0;
x=rect.Width()-height*10;
for(i=0;i<height;i++)
{
for(j=0;j<height;j++)
{
COLORREF color=MemDC.GetPixel(j, i);
dc.FillSolidRect(x+j*10,y,9,9,color);
}
y+=10;
}
    ::DeleteObject(hfont);
MemBitmap.DeleteObject(); 
MemDC.DeleteDC(); 
}
/*23*GetFontToFile从文件获取字体**************************/ 
/*CArchive &ar文档类 int width, int height整型宽高    ****/
void CFONTDlg::GetFontToFile(CDC *pDC, CArchive &ar, int width, int height)//ok
{
int i, j;
for(i=0; i<height; i++)
{
ar << '\t';                              //水平制表(HT) (跳到下一个TAB位置)
for(j=0; j<width; j++)
{
COLORREF color = pDC->GetPixel(j+m_Movx, i+m_Movy);
ar <<  (ColorToBool(color)? '_': 'X');
if( (j+1)%8 == 0 )                   //
ar<<',';                         //
}
j=(j)%8;
if(j!= 0)
{
for(;j<8;j++)
{
ar<<'_';
}
ar<<',';
}
ar<<'\r'<<'\n';                      //\r回车(CR) ,将当前位置移到本行开头
}
ar<<'\r'<<'\n';                          //\n将当前位置移到下一行开头
}
/*24横向取模**********************************************/ 
int CFONTDlg::TCharToZi(CDC *pDC, WCHAR ch, CString &str)//ok
{
    int height=abs(lf.lfHeight);                 //绝对值下拉列表框的负值转正
    m_Edit5.SetSel(0,-1);                        //测试代码选上所有内容
    m_Edit5.ReplaceSel("");                      //测试代码显示编辑框2内容 
char sPos[10];                               //测试代码
itoa(height,sPos,10);                        //测试代码
    m_Edit5.ReplaceSel(sPos);                    //测试代码
    int width=ch>0xA0? height: height/1;         //大于0xA0 /2改/1数字全屏显示
int i=(width+7)/8 ;                          //
int cnt=height * i;                          //
BYTE *buff, *pd;                             //
char chBuff[4]={0};                          //
int x,y;                                     //
buff=(BYTE *)malloc(cnt);                    //使用malloc分配内存的首地址,然后赋值给buff             
if( buff==NULL)                              //
    return FALSE;                                //
    pd=buff;                                     //
ZeroMemory(buff, cnt);                       //ZeroMemory宏用0来填充一块内存区域
    chBuff[0]=ch&0xFF;                           //
if(ch>0xA0)                                  //
{                                            //
chBuff[1]=(ch>>8)&0xFF;

/**%s字符串%d十进制**\r回车将当前位置移到本文开头\n换行
将当前位置移到下一行开头,\t水平制表跳到下一个tab位置**/
//str.Format("\r\n\t/*%s%dx%d 横向取模*/\r\n\t{", chBuff, width, height);
//chBuff要转换代码的汉字 
//str.Format("\r\n\t/*%s%dX%d 横向取模*/\r\n\t\n", chBuff, width, height);//注销中文显示
pDC->FillSolidRect(0, 0, height+10, height+10, RGB(255,0,0));
pDC->TextOut(0, 0, chBuff, 2);               //
TRACE("\r\n%s\r\n", chBuff );                //TRACEWIN.H
for(y=0; y<height; y++)                      //字体高
{
for(x=0;x<width;x++)                     //字体宽
{
*pd<<=1;                             //左移一位
COLORREF color=pDC->GetPixel(x+m_Movx, y+m_Movy);
if(!ColorToBool(color))              //判断颜色
{
TRACE("%c", 'X');                //输出一个字符
*pd|=0x01;                       //最低位相或
}
else
TRACE("%c", '_');                //
            if( (x+1)%8 == 0)
{
TRACE("%c", ',');                    //移动8位
pd++;                                //加一
}
}
x=x%8;                                   //
if(x)                                    //
{                                        //
for(;x<8;x++)                        //
TRACE("%c",'_');                     //
            TRACE("%c",',');                     //
*pd >>= 8-x;                         //
pd++;                                //
}                                        //
TRACE("\r\n");                           //
}                                            //
CString out;                                 //
for( i=0; i<cnt-1; i++)                      //
{                                            //
out.Format("%02X ", buff[i]);          //x 必须是一个整形值,以十六进制的形式返回."%02X(空格)"
str+=out;                                //
}                                            //
   // out.Format("0x%02X}", buff[i]);              //输出大扩弧右部}
str += out;
    free(buff);
return TRUE;
}
/*25纵向取模**********************************************/ 
/*1:函数 void CFONTDlg::OnSelchangeCombo1()中            */
/*2:lf.lfHeight= buff[m_CBox.GetCurSel()];************** */


int CFONTDlg::TCharToZiH(CDC *pDC, WCHAR ch, CString &str)//ok
{
    int height=abs( lf.lfHeight );//lf.lfHeight = buff[m_CBox.GetCurSel()];
int  width=ch>0xA0? height: height/1;      //BYTE字节
int      i=(height+7)/8 ;
int    cnt=width * i;
BYTE   *buff,*pd;                          //字节类指针
char   chBuff[4]={0};                      //字符数据表
int x,y,j;
buff=(BYTE *) malloc( cnt );               //向系统申请分配指定BYTE *字节的内存空间
if(buff==NULL)                             //如果buff==NULL
return FALSE;                              //返回假
pd=buff;                                   //
ZeroMemory(buff, cnt );                    //用0来填充一块内存区域
chBuff[0]=ch&0xFF;                         //
if(ch>0xA0 )                               //1010 0000   
{
chBuff[1]=(ch>>8)&0xFF;                //

/**%s字符串%d十进制**\r回车将当前位置移到本文开头\n换行
将当前位置移到下一行开头,\t水平制表跳到下一个tab位置
Format是CString类的一个成员函数,它通过格式操作使任意
类型的数据转换成一个字符串。 FillSolidRect调用该成员
函数具有指定的纯色填充给定矩形的函数 **/
str.Format("\r\n\t/*%s%dx%d 纵向取模*/\r\n{\n", chBuff, width, height);
pDC->FillSolidRect(0, 0, height+10, height+10, RGB(255,0,0));
pDC->TextOut(0, 0, chBuff, 2);
    for(j=0; j<height/8; j++)
{
y=j*8;
for(x=0;x<width;x++)
{
for(i=0;i<8;i++)
{

*pd<<=1;
COLORREF color = pDC->GetPixel(x+m_Movx, y+i+m_Movy);
if( !ColorToBool(color) )
{
*pd|=0x01;
}
}
pd++;
}
}
if( height % 8 )
{
y=j*8;
for(x=0;x<width;x++)
{
for(i=0;i<8;i++)
{

*pd>>=1;                         //<<? GetPixel检索指定坐标点像素RGB颜色值。
COLORREF color = pDC->GetPixel(x+m_Movx, y+i+m_Movy);
if( !ColorToBool(color) )
{
*pd|=0x80;                      //0X01?
}
}
pd++;                                //指针加一
}
}
CString out;
for( i=0; i<cnt-1; i++)
{
out.Format("0x%02X,", buff[i]);          //格式化
str+=out;
}
    out.Format("0x%02X}", buff[i]);
str+=out;
    free(buff);                                  //释放
return TRUE;
}
/*26**********************************************/ 
void CFONTDlg::UpdateFont(CDC *pDC)  //ok
{
    UpdateData(TRUE);                                 //MFC的窗口函数,用来刷新数据
CDC       MemDC;   
CBitmap   MemBitmap;
int height = abs( lf.lfHeight );
    MemDC.CreateCompatibleDC(NULL);                   //创建一个与指定设备兼容的内存设备上下文环境(DC)
MemBitmap.CreateCompatibleBitmap(pDC, 100, 100);  //创建与指定的设备环境相关的设备兼容的位图
CBitmap  *pOldBit=MemDC.SelectObject(&MemBitmap); //选择一对象到指定的设备上下文环境中选择一对象到指定的设备上下文环境中
    HFONT hfont = ::CreateFontIndirect(&lf);          //创建一种在指定结构定义其特性的逻辑字体
CFont* pfont = CFont::FromHandle(hfont);          //new一个CWnd对象
    CFont* def_font = MemDC.SelectObject(pfont);      //选择一对象到指定的设备上下文环境中选择一对象到指定的设备上下文环境中
CString str;                                      //定义一个CString类对象 str
m_Edit.GetWindowText(str);                        //将指定窗口的标题条文本拷贝到一个缓存区内->编辑框1
MemDC.FillSolidRect(0, 0, 100, 100, RGB(255,255,255));//DDX_Control(pDX, IDC_EDIT1, m_Edit);
MemDC.TextOut(0, 0, str, str.GetLength());        //获取字符串长度
MemDC.SelectObject(def_font);                     //选择一对象到指定的设备上下文环境中
int i,j;
int x, y;
y = 0;
x = 0;
for(i=0; i<height; i++)
{
for(j=0; j<height; j++)
{
COLORREF color=MemDC.GetPixel(j+m_Movx, i+m_Movy);
pDC->FillSolidRect(x+j*10, y, 9, 9, color);
}
y += 10;
}
    ::DeleteObject(hfont);                       //
    MemBitmap.DeleteObject();                    //
MemDC.DeleteDC();                            //删除指定的设备上下文环境(Dc)。
}
/*DeleteObject删除一个逻辑笔、画笔、字体、位图、
区域或者调色板,释放所有与该对象有关的系统资源,
在对象被删除之后,指定的句柄也就失效了。*  **/
/*27**********************************************/ 
void CFONTDlg::OnSelchangeCombo1() 
{
// TODO: Add your control notification handler code here
int buff[] = {-16,-24,-32,-40,-48,-56,-64};  //m_CBox ::DoDataExchange(CDataExchange* pDX)
lf.lfHeight = buff[m_CBox.GetCurSel()];      //返回组合框中列表框中当前选中的项的下标
Invalidate();                                //重绘窗口
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值