扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:WallesCai 来源:CSDN 2007年10月14日
关键字:
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long |
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long |
Private Declare Function GetCurrentObject Lib "gdi32" (ByVal hdc As Long, ByVal uObjectType As Long) As Long |
Private Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BitMapInfo, ByVal wUsage As Long) As Long |
Private Declare Function timeGetTime Lib "winmm.dll" () As Long |
Private Type BitMapInfoHeader '文件信息头——BITMAPINFOHEADER biSize As Long biWidth As Long biHeight As Long biPlanes As Integer biBitCount As Integer biCompression As Long biSizeImage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As Long biClrImportant As Long End Type Private Type RGBQuad rgbBlue As Byte rgbGreen As Byte rgbRed As Byte 'rgbReserved As Byte End Type Private Type BitMapInfo bmiHeader As BitMapInfoHeader bmiColors As RGBQuad End Type |
Private Const Bits As Long = 32 '颜色深度,这里把所有图像都按照32位来处理 Public Done As Boolean '用于标记一个过程是否结束 Public TimeGet As Long '用于记录输入过程处理所花费的时间 Public TimePut As Long '用于记录输出过程处理所花费的时间 Dim ColVal() As Byte '用于存放从DIB输入的像素值 Dim ColOut() As Byte '用于存放向DIB输出的像素值 Dim InPutHei As Long '用于记录输入图像的高度 Dim InPutWid As Long '用于记录输入图像的宽度 Dim bi24BitInfo As BitMapInfo '定义BMP信息 |
Public Sub CopyData(ByVal W As Long, ByVal H As Long) Dim Length As Long Dim I As Long Dim L As Long I = Bits \ 8 L = I - 1 Length = (W + 1&) * (H + 1&) * I ReDim ColOut(L, W, H) CopyMemory ColOut(0, 0, 0), ColVal(0, 0, 0), Length End sub |
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSrc As Any, ByVal ByteLen As Long) |
sub command1_click() With picture1 .ScaleMode=3 .BorderStyle=0 DibGet .hdc,0,0,.scalewidth,.scaleheight End With CopyData InPutHei ,InPutWid picture2.AutoRedraw=True DibPut picture2.hdc picture2.refresh end sub |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者