需要再创建一个表层。注意使用GetStockObject hddRval = m_pOsdSurface->GetDC(&hDC); CRect osdRect(m_ptStart.x, m_ptStart.y, m_ptEnd.x, m_ptEnd.y); HBRUSH brush=(HBRUSH)GetStockObject(NULL_BRUSH); HPEN pen = CreatePen(PS_SOLID, 2, RGB(0, 255, 0)); HPEN oldPen = SelectObject(hDC, pen); HBRUSH oldBrush = SelectObject(hDC, brush); Rectangle(hDC, m_ptStart.x, m_ptStart.y, m_ptEnd.x, m_ptEnd.y); SelectObject(hDC, oldPen); SelectObject(hDC, oldBrush); DeleteObject(pen); DeleteObject(brush); TRACE("DrawYUV420P:%d, %d, %d, %d/n", m_ptStart.x, m_ptStart.y, m_ptEnd.x, m_ptEnd.y); m_pOsdSurface->ReleaseDC(hDC);