Void CDialogbar: : OnPaint ()
{
CPaintDC dc (this);//device context for painting
CBitmap BMP.
BMP. LoadBitmap (IDB_BITMAP1);
BITMAP bp;
BMP. GetBitmap (& bp);
If (BMP) m_hObject)
{
BMP. DeleteObject ();
}
The CDC dcCompatible;
DcCompatible. CreateCompatibleDC (& dc);
DcCompatible. SelectObject (& BMP);
CRect the rect.
GetDlgItem (IDC_LIST1) -> GetWindowRect (& the rect);
The ScreenToClient (& the rect);
Dc. StretchBlt (the rect. Left, the rect. Top, the rect. Width (), the rect. Height (), & dcCompatible, 0, 0, bp, bmWidth, bp, bmHeight, SRCCOPY);
((CListBox *) GetDlgItem (IDC_LIST1)) -> AddString (" huang ");