我测试了StretchBlt函数直接绘制图像到画布(Picture1.hdc)和绘制图像到内存画布(mDIB.hdc)上的速度,我惊奇的发现直接绘制在画布上的速度远远快于绘制在内存画布上的速度,这是为什么呢?有办法提升绘制在内存画布上的速度吗?Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As LongCall StretchBlt(mDIB.hdc, 0, 0, 500, 500, m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, vbSrcCopy)
Call StretchBlt(Picture1.hdc, 0, 0, 500, 500, m_hDC, xSrc, ySrc, nSrcWidth, nSrcHeight, vbSrcCopy)