VB中怎么获取图片的像素值
展开全部
你的问题可以这样的解决:
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Print "该点的象素RGB值是:"; GetPixel(Picture1.hdc, x, y)
End Sub
getpixel函数的用法:
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
说明
在指定的设备场景中取得一个像素的RGB值
返回值
指定点的RGB颜色。如指定的点位于设备场景的剪切区之外,则返回CLR_INVALID
给你的一点建议:学习vb一定要学习vb的api,非常的重要!!
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Print "该点的象素RGB值是:"; GetPixel(Picture1.hdc, x, y)
End Sub
getpixel函数的用法:
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
说明
在指定的设备场景中取得一个像素的RGB值
返回值
指定点的RGB颜色。如指定的点位于设备场景的剪切区之外,则返回CLR_INVALID
给你的一点建议:学习vb一定要学习vb的api,非常的重要!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询