如何获取窗体中某点的颜色值
如题,请高手解答
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Cls
Dim sj As Long
Dim ColorZ(1 To 3) As Byte
sj = Me.Point(X, Y)
ColorZ(1) = (sj Mod 65536) Mod 256 'Red
ColorZ(2) = (sj Mod 65536) \ 256 'Green
ColorZ(3) = sj \ 65536 'Blue
Print "Red="; (Val(sj) Mod 65536) Mod 256 'Red
Print "Green="; (Val(sj) Mod 65536) \ 256 'Green
Print "Blue="; Val(sj) \ 65536 'Blue
Shape1.FillColor = RGB(ColorZ(1), ColorZ(2), ColorZ(3))
End Sub