DrawText上下左右居中输出文字
来源:互联网 发布:dnf强行交易软件 编辑:程序博客网 时间:2024/04/30 12:15
CView OnDraw:设置字体,设置背景色,设置输出文字颜色,居中输出
// TODO: add draw code for native data hereCDocument* pDoc = GetDocument();CPaintDC* dc = (CPaintDC*)pDC;CRect rect;CBrush brush;brush.CreateSolidBrush(RGB(150,150,150));this->GetClientRect(&rect);dc->FillRect(&rect, &brush);brush.DeleteObject();CFont font;font.CreateFont(50, // nHeight0, // nWidth0, // nEscapement0, // nOrientationFW_NORMAL, // nWeightFALSE, // bItalicFALSE, // bUnderline0, // cStrikeOutANSI_CHARSET, // nCharSetOUT_DEFAULT_PRECIS, // nOutPrecisionCLIP_DEFAULT_PRECIS, // nClipPrecisionDEFAULT_QUALITY, // nQualityDEFAULT_PITCH | FF_SWISS,_T("Arial") // nPitchAndFamily Arial); pDC->SelectObject(&font);SetBkColor(pDC->m_hDC, RGB(150,150,150));//SetBkMode(pDC->m_hDC, TRANSPARENT);SetTextColor(pDC->m_hDC, RGB(255,0,0)); CString tout = "No Video!\nNo webcam or only one webcam!";CRect temp = rect;int height = pDC->DrawText(tout, temp, DT_CENTER | DT_WORDBREAK | DT_EDITCONTROL | DT_CALCRECT);rect.DeflateRect(0, (rect.Height() - height)/2);// change rect pDC->DrawText(tout, rect, DT_CENTER | DT_WORDBREAK | DT_EDITCONTROL);
0 0
- DrawText上下左右居中输出文字
- ANDROID drawText实现文字居中
- android canvas drawText()文字居中
- Android Canvas drawText()文字居中
- canvas drawText文字垂直居中
- android canvas drawText()文字居中
- div中的文字上下左右居中
- Android 中Canvas.drawText实现文字居中
- android drawtext 如何使文字居中
- canvas.drawText文字居中(备忘)
- canvas.DrawText让文字真正居中显示
- Android之drawText()文字居中问题
- div中的文字上下左右居中的方法
- android drawText时使文字居中、获取文字宽高
- Android 史上最简单的实现Canvas drawText文字垂直居中
- css任意图片文字上下左右都居中对齐
- Delphi DBGridEh 嵌入图片,显示文字,且上下左右居中
- 向窗口输出文字--TextOut和DrawText函数
- 关于RecycleView你想了解的或许在这里
- android 快速开发工具
- 线程控制方法概述
- linux shell基础
- JAVA同步回调函数
- DrawText上下左右居中输出文字
- 景子渊:API大幅利多,原油涨幅为何低迷?金银居高不下,空单被套怎么办?
- cookie工具类
- 自定义图表控件(坐标系)
- utf-8和gb2312 区别
- MVC 三层架构在各框架中的特征
- 欢迎使用CSDN-markdown编辑器
- WordPress评论表单增加字段
- Struct In Memory