02-27-2012، 09:48 PM
با سورس زیر که نوشتم یکی میتونید رنگ پیکسل ها رو بگیرید عوض کنید و حتی در پیکسل ها به صورت hex color بگردید و رنگ مورد نظر خود رو با کد رنگ Rgb تغییر بدید.
کد:
'Find Pixel Color (Hex Color) & Change Color Pixel (Rgb Input) & Get Color Pixel Image With Visual Basic 6
'Programmer : Mohammad Amin Mansouri
'Public By : Www.parsicoders.com (Persian Team)
Private X As Long
Private Y As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, _
ByVal Y As Long) As Long
Public Function FindPixelColor(Color As String, R As Integer, G As Integer, b As Integer)
For X = 1 To Picture1.ScaleWidth
For Y = 1 To Picture1.ScaleHeight
If Hex(Picture1.Point(X, Y)) = Color Then
Picture1.PSet (X, Y), RGB(R, G, b)
End If
Next
Next
End Function
Private Sub Command1_Click()
Call FindPixelColor(Colorr.Text, R.Text, G.Text, b.Text)
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Caption = Hex(Picture1.Point(X, Y))
End Sub