?
? PS_SOLID 实线 Creates a solid pen. PS_DASH 虚线,宽度必须为一 Creates a dashed pen. Valid only when the pen
width is 1 or less, in device units.
? PS_DOT 点线,宽度必须为一 Creates a dotted pen. Valid only when the pen
width is 1 or less, in device units.
? PS_DASHDOT 点划线,宽度必须为一 Creates a pen with alternating dashes and
dots. Valid only when the pen width is 1 or less, in device units.
? PS_DASHDOTDOT 双点划线,宽度必须为一 Creates a pen with alternating
dashes and double dots. Valid only when the pen width is 1 or less, in device units.
?
?
? PS_NULL 空线,使用时什么也不会产生 Creates a null pen. PS_ENDCAP_ROUND 结束处为圆形 End caps are round. PS_ENDCAP_SQUARE 结束处为方形 End caps are square.
nWidth和crColor为线的宽度和颜色。
刷子是在画封闭曲线时用来填充的颜色,例如当你画圆形或方形时系统会用当前的刷子对内部进行填充。刷子可利用CBrush对象产生。通过以下几种函数创建刷子:
?
? BOOL CreateSolidBrush( COLORREF crColor ); 创建一种固定颜色的刷子 BOOL CreateHatchBrush( int nIndex, COLORREF crColor ); 创建指定颜色和网格
的刷子,nIndex可取以下值:
?
?
?
?
?
? HS_BDIAGONAL Downward hatch (left to right) at 45 degrees HS_CROSS Horizontal and vertical crosshatch HS_DIAGCROSS Crosshatch at 45 degrees HS_FDIAGONAL Upward hatch (left to right) at 45 degrees HS_HORIZONTAL Horizontal hatch HS_VERTICAL Vertical hatch
? BOOL CreatePatternBrush( CBitmap* pBitmap ); 创建以8*8位图为模板的刷子 在选择了画笔和刷子后就可以利用Windows的作图函数进行作图了,基本的画线函数有以下几种
?
?
?
? CDC::MoveTo( int x, int y ); 改变当前点的位置 CDC::LineTo( int x, int y ); 画一条由当前点到参数指定点的线 CDC::BOOL Arc( LPCRECT lpRect, POINT ptStart, POINT ptEnd ); 画弧线 CDC::BOOL Polyline( LPPOINT lpPoints, int nCount ); 将多条线依次序连接 基本的作图函数有以下几种:
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-35251-10.html
麻麻今天去看小王子
我们是有了里子