+ -
当前位置:首页 → 问答吧 → 关于GreateCompatibleDC函数

关于GreateCompatibleDC函数

时间:2011-06-01

来源:互联网

怎么用GreateCompatibleDC函数创建的DC不能保存位图?
_ProcTimer proc _hWnd,uMsg,_idEvent,_dwTime
local @hDc1,@hDc2,@hDc,@empty
local @stRect:RECT
LOCAL @stPoint:POINT
invoke GetDC,hWin1
mov @hDc1,eax
invoke GetDC,hWin2
mov @hDc2,eax 
invoke CreateCompatibleDC,@hDc1
mov @hDc,eax
;invoke GetClientRect,hWin1,addr @stRect
;invoke RtlZeroMemory,addr @stPoint,sizeof @stPoint
;invoke PlgBlt,@hDc,addr @stPoint,@hDc1,0,0,100,100,0,0,0
;invoke PlgBlt,@hDc2,addr @stPoint,@hDc,0,0,100,100,0,0,0


;invoke GetClientRect,hWin1,addr @stRect
invoke BitBlt,@hDc,0,0,100,100,@hDc1,0,0,SRCCOPY ;(1)这两段执行了位图没被传到@hDc2
invoke BitBlt,@hDc2,0,0,100,100,@hDc,0,0,SRCCOPY ;(2)
;invoke StretchBlt,@hDc2,0,0,200,170,\
; @hDc1,0,0,100,100,SRCCOPY
;invoke StretchBlt,@hDc2,0,0,200,170,\
; @hDc,0,0,100,100,SRCCOPY
invoke ReleaseDC,hWin1,@hDc1
invoke ReleaseDC,hWin2,@hDc2
ret

_ProcTimer endp

作者: pop004dym   发布时间: 2011-06-01

出错了吗?出错代码有没?

作者: mydo   发布时间: 2011-06-01

没出错码,,只是窗口上没有显示出@hDc1对应窗口DC的图像,

作者: pop004dym   发布时间: 2011-06-01