GDI+ 플래시 없는 드로잉

1064 단어
GDI+ 플래시 없는 드로잉
GDI+ OnDraw , Bitmap , Bitmap Graphics , 
 , DrawImage 。
void CDataView::OnDraw(CDC* pDC)
{
    CDocument* pDoc = GetDocument();
    // TODO:  
    pDC->TextOut(100,100,L" ");

    Graphics g(pDC->m_hDC); 

    CRect rcClient; 
    GetClientRect(&rcClient); 
    Bitmap bmp(rcClient.Width(), rcClient.Height()); 
    Graphics * buffergraphics = Graphics::FromImage(&bmp);// , 
    SolidBrush brush(Color(255, 0,0, 255)); 
    buffergraphics ->FillRectangle(&brush,0, 0, rcClient.Width(),rcClient.Height()); // 

    g.DrawImage(&bmp,0, 0, rcClient.Width(), rcClient.Height());// 
    delete buffergraphics ; 
    g.ReleaseHDC(pDC->m_hDC);

}

좋은 웹페이지 즐겨찾기