在一个多(单)文档窗口中显示一副图片,用鼠标可以任意拖动位置,并且能对图片进行拉伸,实现缩放的效果。请各位给点个提示或是思路。谢谢!

解决方案 »

  1.   

    CDC dcMem;
        dcMem.CreateCompatibleDC (pDC);    CBitmap bitmap;
        bitmap.CreateCompatibleBitmap (pDC, 32, 32);
        CBitmap* pOldBitmap = dcMem.SelectObject (&bitmap);    CBrush* pBrush = new CBrush (clrBackColor);
        dcMem.FillRect (CRect (0, 0, 32, 32), pBrush);
        delete pBrush;    int nIndex = GetCurSel ();
        if (nIndex != LB_ERR)
            dcMem.DrawIcon (0, 0, (HICON) GetItemData (nIndex));    pDC->StretchBlt (pRect->left, pRect->top, pRect->right - pRect->left,
            pRect->bottom - pRect->top, &dcMem, 0, 0, 32, 32, SRCCOPY);    dcMem.SelectObject (pOldBitmap);