MFC cdc hdc 等

/*
HDC hdc;
hdc = ::GetDC(m_hWnd);
MoveToEx(hdc,m_ptOrigin.x, m_ptOrigin.y,NULL);
LineTo(hdc,point.x,point.y );
::ReleaseDC(m_hWnd,hdc);
*/
/*
CDC *pDC = GetDC();
pDC->MoveTo(m_ptOrigin);
pDC->LineTo(point);
ReleaseDC(pDC);
*/
/*
CClientDC dc(this);
// CClientDC dc(GetParent());
dc.MoveTo(m_ptOrigin);
dc.LineTo(point);
*/
/*
CWindowDC dc(GetParent());
dc.MoveTo(m_ptOrigin);
dc.LineTo(point);
*/
/*
CWindowDC dc(GetDesktopWindow());
dc.MoveTo(m_ptOrigin);
dc.LineTo(point);
*/
   /*
CClientDC dc(this);
CPen pen(PS_SOLID, 1,RGB(255,0,0));
CPen* pOldPen = dc.SelectObject(&pen);
dc.MoveTo(m_ptOrigin);
dc.LineTo(point);
dc.SelectObject(pOldPen);
    */
/*
CBrush brush(RGB(255,0,0));
CClientDC dc(this);
dc.FillRect(CRect(m_ptOrigin,point),&brush);
*/


/*  位图画刷
CBitmap bitmap;
bitmap.LoadBitmapW(IDB_BITMAP1);
CBrush brush(&bitmap);
CClientDC dc(this);
dc.FillRect(CRect(m_ptOrigin,point),&brush);
*/
/*
//透明画刷


CClientDC dc(this);
CBrush *pBrush = 
CBrush::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH));
CBrush *pOldBrush = dc.SelectObject(pBrush);
dc.Rectangle(CRect(m_ptOrigin,point));
dc.SelectObject(pOldBrush);
*/

你可能感兴趣的:(MFC)