【文件属性】:
文件名称:VC++自动绘制表格和输出文字
文件大小:25KB
文件格式:7Z
更新时间:2017-04-01 12:31:36
VC++ 自动绘制表格 输出文字
VC++自动绘制表格和输出文字,
//函数功能:给定指定原点输出文字
//参数start_x,start_y,text分别为原点坐标x,y和文本的内容
void CDrawDlg::MyDrawText(int start_x,int start_y,CString text,int txtStyle)
{
CDC* pdc = GetDC();
CFont mfont;
pdc->SetBkMode(TRANSPARENT);
CRect mrect;
GetClientRect(mrect);
//pdc->FillRect(mrect,NULL);
//pdc->GetViewportOrg(mrect.Width()/2,mrect.Height()/2);
mfont.CreateFont(-14,-7,0,0,100,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_ROMAN,"宋体");
pdc->SelectObject(&mfont);
pdc->SetTextColor(RGB(255,0,0));
pdc->TextOut(start_x,start_y,text);
。。。。。。
【文件预览】:
Draw
----stdafx.cpp(135B)
----Draw.vcproj(5KB)
----Draw.aps(58KB)
----Draw.vcproj.ASUSPC.Administrator.user(1KB)
----res()
--------Draw.rc2(360B)
--------Draw.ico(21KB)
----stdafx.h(2KB)
----Draw.rc(6KB)
----Draw.cpp(2KB)
----DrawDlg.cpp(8KB)
----targetver.h(1KB)
----DrawDlg.h(1KB)
----Draw.h(429B)
----resource.h(1KB)
----Draw.vcproj.20131018-1342.Administrator.user(1KB)
----ReadMe.txt(3KB)
Draw.sln
网友评论
- 不错, 不过没用上
- 挺好的资源,谢谢楼主
- 很好的资料
- 很好的资料