評價: 0 回應: 0 閱覽: 95
置頂

CBitmapDC StretchBlt問題

想把原本的圖像(MemDC)
轉成10分之3的大小(xxx)
放在原本圖像左上角
但顯示不出來
請問問題在哪裡?

xxx用的StretchBlt中的nSrcWidth、nSrcHeight似乎錯誤
若縮小數值
會有MemDC的畫面出來
但我不懂這樣是什麼意思?
應該要多小才是正確數值?

 

int xWidth = (_drawArea.Width() * 3 / 10);
int xHeight = (_drawArea.Height() * 3 / 10);

CBitmapDC xxx(
        xWidth,
        xHeight);

xxx.StretchBlt(0,0,
        xWidth,
        xHeight,
        &MemDC,0,0,
        _drawArea.Width(),
        _drawArea.Height(),SRCCOPY);    //把MemDC縮小到xxx

MemDC.BitBlt(
        0,0,
        xWidth,
        xHeight,
        &xxx,0,0,
         SRCCOPY);      //MemDC放入xxx至左上角

 

會員登入 (先登入會員才能回覆留言喔!)

Facebook留言