我现在已经在静态框上贴图了 ,怎么取静态框上的图片,在选择图片放到对话框作为背景

解决方案 »

  1.   

    加入静态框上贴的是 IDB_BITMAP_SKIN ,那么m_bitmapBack.LoadBitmapW(IDB_BITMAP_SKIN);void CGuanyinDlg::OnPaint()
    {
        if (IsIconic())
        {
            CPaintDC dc(this);         SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);        int cxIcon = GetSystemMetrics(SM_CXICON);
            int cyIcon = GetSystemMetrics(SM_CYICON);
            CRect rect;
            GetClientRect(&rect);
            int x = (rect.Width() - cxIcon + 1) / 2;
            int y = (rect.Height() - cyIcon + 1) / 2;        dc.DrawIcon(x, y, m_hIcon);
        }
        else
        {
            CRect r;
            GetClientRect(&r);
            CPaintDC dc(this);
                dc.DrawState(CPoint(0,0), CSize(r.Width(), r.Height()), m_bitmapBack, DST_BITMAP);
        }
    }效果是