1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| void CTestView::OnDraw(CDC* pDC)
{
CRect rctWindowSize;
GetClientRect(rctWindowSize); // toute la vue
if (!m_Image.IsNull()) // l'image est-elle chargée
{ // je copie les bits de mon image sur le dc avec possibilité de compression avec StretchBlt()
m_Image.StretchBlt(*pDC, 0, 0, rctWindowSize.Width(), rctWindowSize.Height(), SRCCOPY);
}
else
{
CBrush* pOldBrush = (CBrush*) pDC->SelectStockObject(WHITE_BRUSH);
pDC->Rectangle(rctWindowSize);
pDC->SelectObject(pOldBrush);
}
} |
Partager