扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
Public Sub DibGet(ByVal IdSource As Long, XBegin As Long, ByVal YBegin As Long, ByVal XEnd As Long, ByVal YEnd As Long) Dim iBitmap As Long Dim iDC As Long Dim I As LongDim Dim W As Long Dim H As Long On Error GoTo ErrLine Done = False TimeGet = timeGetTime InPutWid = XEnd - XBegin InPutHei = YEnd - YBegin W = InPutWid + 1 H = InPutHei + 1 I = (Bits \ 8) - 1 ReDim ColVal(I, InPutWid, InPutHei) With bi24BitInfo.bmiHeader .biBitCount = Bits .biCompression = 0& .biPlanes = 1 .biSize = Len(bi24BitInfo.bmiHeader) .biWidth = W .biHeight = H End With iBitmap = GetCurrentObject(IdSource, 7&) GetDIBits IdSource, iBitmap, 0&, H, ColVal(0, 0, 0), bi24BitInfo, 0& DeleteObject iBitmap Done = True TimeGet = timeGetTime - TimeGetExit Sub ErrLine: MsgBox "错误号:" & Err.Number & ":" & Err.Description End Sub |
Public Sub DIBPut(ByVal IdDestination As Long) Dim W As Long Dim H As Long On Error GoTo ErrLine Done = False TimePut = timeGetTime W = OutPutWid + 1 H = OutPutHei + 1 With bi24BitInfo.bmiHeader .biWidth = W .biHeight = H LineBytes = ((W * Bits + 31) And &HFFFFFFE0) \ 8 .biSizeImage = LineBytes * H End With SetDIBitsToDevice IdDestination, 0, 0, W, H, 0, 0, 0, H, ColOut(0, 0, 0), bi24BitInfo.bmiHeader, 0 Done = True TimePut = timeGetTime - TimePut Exit Sub ErrLine: MsgBox Err.Description End Sub |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者