:311.774KB : :1 :2021-02-11 17:23:40
判断位深是否符合要求
.如果真 (hSrcDC = 0 或 nBitCount ≠ 1 且 nBitCount ≠ 4 且 nBitCount ≠ 8 且 nBitCount ≠ 16 且 nBitCount ≠ 24 且 nBitCount ≠ 32)
返回 (假)
.如果真结束
nSrcWidth = SrcRect.Right - SrcRect.Left ' 算出位图宽度
nSrcHeithe = SrcRect.Bottom - SrcRect.Top ' 算出位图高度
' 确保该dib的大小,颜色位数符合要求
.如果真 (m_pDIB = { } 或 GetBitCount () ≠ nBitCount 或 GetWidth () ≠ nSrcWidth 或 GetHeight () ≠ nSrcHeithe)
m_pDIB = { }
Create (nSrcWidth, nSrcHeithe, nBitCount, )
.如果真结束
' 创建DibSection并选进以MemDC
hMemDC = CreateCompatibleDC (hSrcDC)
pSrcBits = 0
hDibSect = CreateDIBSection (hSrcDC, m_pDIB, #DIB_RGB_COLORS, pSrcBits, 0, 0)
hOldBitmap = SelectObject (hMemDC, hDibSect)
' 复制源dc内容到MemDC即到DibSection
BitBlt (hMemDC, 0, 0, nSrcWidth, nSrcHeithe, hSrcDC, SrcRect.Left, SrcRect.Top, #SRCCOPY)
GdiFlush ()
' 复制位图点阵数据到本DIB对象
memcpy (GetBitsAddress (), pSrcBits, GetBitsSize ())
' 删除相关句柄
R = DeleteObject (SelectObject (hMemDC, hOldBitmap))
R = DeleteObject (hOldBitmap)
DeleteDC (hMemDC)
01-25whatsapp开源,无模块仅供研究
08-02大漠插件,雷电多线程纯源码无模块
11-11键盘源码,功能强大无模块
11-08易语言反截图,基于API源码无模块
05-08gif录像软件无模块
04-04窗口句柄修改软件图标和软件标题
01-31API无模块窗口玻璃效果
01-23自主无模块开发即时通讯工具
01-17单号批量查询,支持单号导入无模块