创建画笔:
BOOL CreatePen( int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, int nStyleCount = 0, const DWORD* lpStyle = NULL );
nPenStyle 有PS_SOLID,PS_DASH,PS_DOT,PS_DASHDOT,PS_DASHDOTDOT,PS_NULL

也就是实线,虚线,点虚线,点划线,双点划线,空笔(不可见),其值分别为0,1,2,3 ,4,5
// mypen.CreatePen(0,0,RGB(0,0,255));

画笔选入选出设备环境:

CPen* SelectObject( CPen* pPen ); 
类似的有:

CBrush* SelectObject( CBrush* pBrush );

virtual CFont* SelectObject( CFont* pFont );

CBitmap* SelectObject( CBitmap* pBitmap );

int SelectObject( CRgn* pRgn );
画笔删除:

BOOL DeleteObject( );                           //mypen.DeleteObject();

Return Value

Nonzero if the GDI object was successfully deleted; otherwise 0.


画线函数:
MoveTo(int i,int j); //origin point
LineTo(int i,int j);  //destination