[問題] CBitmapDC StretchBlt問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
MFC
問題(Question):
想把原本的圖像(MemDC)
轉成10分之3的大小(xxx)
放在原本圖像左上角
但顯示不出來
請問問題在哪裡?
餵入的資料(Input):
MemDC是CBitmapDC資料(_drawArea.Width() _drawArea.Height()分別為寬高)
xxx同樣是CBitmapDC資料
預期的正確結果(Expected Output):
xxx圖像會出現在MemDC左上角
錯誤結果(Wrong Output):
xxx用的StretchBlt中的nSrcWidth、nSrcHeight似乎錯誤
若縮小數值
會有MemDC的畫面出來
但我不懂這樣是什麼意思?
應該要多小才是正確數值?
程式碼(Code):
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至左上角
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.250.32.153
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1403751050.A.3FE.html