Professional Documents
Culture Documents
This tutorial of vb6 explain how a programmer can create both a picture color
picker and color shader.
In Visual Basic ,a development environment, a coder can create picture color
picker, in which user can pick the color of the picture and apply it to another .This
program use some of the built in functions.
I think this is a good source for both students and teachers as well.
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As
Long, ByVal Y As Long) As Long
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As
Long, ByVal Y As Long, ByVal crColor As Long) As Long
'Initialising Shading
PicTarget.Cls
sRate = Thickness / 10
For X = 0 To XMax
For Y = 0 To YMax
Col = GetPixel(PicSource.hdc, X, Y)
If Not Col = 0 Then 'Because black colors are usually the borders of an
image and never change border color.It will affect the clarity.
'Resetting the RGB values of current pixel with the sRate of shading
Else
End If
Next Y
PicTarget.Refresh
Next X
End Sub
Now You are ready to Test Your First Shading Program ,By using this You can
Give any color you like to the pictures you using in a VB Project
In order to test the Program you need a Form which contain Three Picture
box control[Original, Processed,ColorPallet as Picture 1] , a scroll bar, and
a picture of color pallet and another as a test picture.
MsgBox Original.Point(X, Y)
End Sub
End Sub
lbThick = scrRate.Value
End Sub
Else
End If
End Sub