[VB6 ] 如何 掃描圖片上點 並判定期顏色?
請問大家如何在vb6的imageg上掃描出一個點的顏色
並判斷其顏色為何
我的目的是把圖片上特定一顏色的點數目求出來
以判斷這個顏色的面積
我找了一晚上 找到一個網站說可以用point來得出座標顏色
他有一個範例是做出類似小畫家一樣 先取得圖片上某一處的顏色
再在其他地方把剛剛取得的顏色用pset點出來
範例如下
Dim point_colo As Variant
Private Sub form_mousedown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
point_colo = Form1.Point(X, Y)
End Sub
Private Sub picture1_mousedown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Picture1.PSet (X, Y), point_colo
End Sub
但我試過以後發現 不論我在哪裡點 pset出來都是黑色的
到底用form1.point 這個方式取得點的顏色對不對阿
再來如假設我已經用上述的方式取得點的顏色後
判斷顏色是否為黑色我是只要打
if point_color=RGB(0,0,0) then 'point_color 為剛剛取得的顏色
....
end if
就好了 請各位高手賜教 叩首 感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.224.78.70
→
05/29 11:25, , 1F
05/29 11:25, 1F
→
06/01 11:46, , 2F
06/01 11:46, 2F