2个回答
展开全部
Private Declare Function GetObject Lib "gdi32 "
Private Declare Function GetBitmapBits Lib "gdi32 "
Private Declare Function SetBitmapBits Lib "gdi32 "
Dim PicBits() As Byte, PicInfo As BITMAP, Cnt As Long
Private Sub Command1_Click()
Set Picture1.Picture = Clipboard.GetData(vbCFBitmap)
GetObject Picture1.Picture, Len(PicInfo), PicInfo
Debug.Print PicInfo.bmWidth * PicInfo.bmHeight * 3
ReDim PicBits(1 To PicInfo.bmWidth * PicInfo.bmHeight * 3) As Byte
GetBitmapBits Picture1.Picture, UBound(PicBits), PicBits(1)
For Cnt = 1 To UBound(PicBits)
PicBits(Cnt) = 255 - PicBits(Cnt)
Next Cnt
SetBitmapBits Picture1.Picture, UBound(PicBits), PicBits(1)
Picture1.Refresh
End Sub
Private Declare Function GetBitmapBits Lib "gdi32 "
Private Declare Function SetBitmapBits Lib "gdi32 "
Dim PicBits() As Byte, PicInfo As BITMAP, Cnt As Long
Private Sub Command1_Click()
Set Picture1.Picture = Clipboard.GetData(vbCFBitmap)
GetObject Picture1.Picture, Len(PicInfo), PicInfo
Debug.Print PicInfo.bmWidth * PicInfo.bmHeight * 3
ReDim PicBits(1 To PicInfo.bmWidth * PicInfo.bmHeight * 3) As Byte
GetBitmapBits Picture1.Picture, UBound(PicBits), PicBits(1)
For Cnt = 1 To UBound(PicBits)
PicBits(Cnt) = 255 - PicBits(Cnt)
Next Cnt
SetBitmapBits Picture1.Picture, UBound(PicBits), PicBits(1)
Picture1.Refresh
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询