CDC::RoundRect
来源:互联网 发布:centos 7 3306端口 编辑:程序博客网 时间:2024/06/15 12:20
来源于MSDN:https://msdn.microsoft.com/zh-cn/library/b0xe62fb(v=vs.110).aspx
CDC::RoundRect
Visual Studio 2012
Draws a rectangle with rounded corners using the current pen.
使用当前的画笔画一个带圆角的矩形
BOOL RoundRect( int x1, int y1, int x2, int y2, int x3, int y3 );BOOL RoundRect( LPCRECT lpRect, POINT point );
Parameters
Return Value
Nonzero if the function is successful; otherwise 0.执行成功返回值非0,否则为0
Remarks
The interior of the rectangle is filled using the current brush.矩形内部(颜色)由当前刷子填充
The figure this function draws extends up to but does not include the right and bottom coordinates. This means that the height of the figure is y2 – y1 and the width of the figure is x2 – x1. Both the height and the width of the bounding rectangle must be greater than 2 units and less than 32,767 units.
x1,y1的值必须小于x2,y2。矩形的高是y2-y1,宽是x2-x1,取值范围为2~32767
Example
C++
void CDCView::DrawRoundRect(CDC* pDC){ // create and select a solid blue brush CBrush brushBlue(RGB(0, 0, 255)); CBrush* pOldBrush = pDC->SelectObject(&brushBlue); // create and select a thick, black pen CPen penBlack; penBlack.CreatePen(PS_SOLID, 3, RGB(0, 0, 0)); CPen* pOldPen = pDC->SelectObject(&penBlack); // get our client rectangle CRect rect; GetClientRect(rect); // shrink our rect 20 pixels in each direction rect.DeflateRect(20, 20); // Draw a thick black rectangle filled with blue // corners rounded at a 17-unit radius. Note that // a radius of three or less is not noticable because // the pen is three units wide. pDC->RoundRect(rect, CPoint(17, 17)); // put back the old objects pDC->SelectObject(pOldBrush); pDC->SelectObject(pOldPen);}
Requirements
Header: afxwin.h
See Also
Reference
CDC Class
Hierarchy Chart
CDC::Rectangle
RoundRect
CRect Class
RECT Structure
POINT Structure
CPoint Class
0 0
- CDC::RoundRect
- RoundRect
- CDC
- CDC
- CDC
- cdc
- CDC
- CDC
- CDC
- Rect,RoundRect(矩形)对象(四)
- VML极道教程(五) RoundRect圆矩型
- VML极道教程(五) RoundRect圆矩型
- CDC::GetPixel
- 编译CDC
- HDC & CDC
- CDC类
- CDC::SetBkMode
- CDC::CreateCompatibleDC
- html禁止清除input文本输入缓存的两种方法
- MFC radio button 设置默认选中
- 大学学习JAVA C#等用到的单词
- LCT学习笔记
- UIViewController的生命周期及iOS程序执行顺序
- CDC::RoundRect
- c#面试1(填空题)
- Linux 网络编程之ioctl函数
- 数据结构-线性表(List)1
- Chrome导致Browser无法保存page/没有浏览记录/无法增加书签
- C++命名空间
- Android布局文件的命名空间
- C++学习日记2——多态篇的纯虚函数和抽象类
- centos 安装sbt