[問題] CBitmapDC StretchBlt問題

看板C_and_CPP作者 (newJoey)時間10年前 (2014/06/26 10:50), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
開發平台(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
文章代碼(AID): #1JgugAF- (C_and_CPP)