- Private Sub Command1_Click()
- Decompose Picture1.BackColor, R, v, b
-
- 'VOILA LES OPERATIONS QUI NOUS INTERESSE
- R = CInt(R / 51) * 51
- v = CInt(v / 51) * 51
- b = CInt(b / 51) * 51
- Picture2.BackColor = RGB(R, v, b)
- Label3 = "R = " & R & " V = " & v & " B = " & b
- End Sub
-
- Private Sub Picture1_Click()
- Com1.ShowColor
- Picture1.BackColor = Com1.Color
- Decompose Picture1.BackColor, R, v, b
- Text1(0) = R
- Text1(1) = v
- Text1(2) = b
- End Sub
-
- Private Sub Text1_Change(Index As Integer)
- On Local Error Resume Next
- Picture1.BackColor = RGB(Val(Text1(0)), Val(Text1(1)), Val(Text1(2)))
- End Sub
-
- 'cette procédure decompose la couleur en R,V,B
- Public Sub Decompose(Couleur, R, v, b)
- R = Int(Couleur Mod 256)
- v = Int((Couleur - R) / 256 Mod 256)
- b = Int((Couleur - R) / 256 / 256)
- Verif R, v, b
- End Sub
-
- 'procédure qui verifi les limites des composantes de la couleur rvb
- Public Sub Verif(R, v, b)
- If R < 0 Then R = 0
- If v < 0 Then v = 0
- If b < 0 Then b = 0
- If R > 255 Then R = 255
- If v > 255 Then v = 255
- If b > 255 Then b = 255
- End Sub
-
Private Sub Command1_Click()
Decompose Picture1.BackColor, R, v, b
'VOILA LES OPERATIONS QUI NOUS INTERESSE
R = CInt(R / 51) * 51
v = CInt(v / 51) * 51
b = CInt(b / 51) * 51
Picture2.BackColor = RGB(R, v, b)
Label3 = "R = " & R & " V = " & v & " B = " & b
End Sub
Private Sub Picture1_Click()
Com1.ShowColor
Picture1.BackColor = Com1.Color
Decompose Picture1.BackColor, R, v, b
Text1(0) = R
Text1(1) = v
Text1(2) = b
End Sub
Private Sub Text1_Change(Index As Integer)
On Local Error Resume Next
Picture1.BackColor = RGB(Val(Text1(0)), Val(Text1(1)), Val(Text1(2)))
End Sub
'cette procédure decompose la couleur en R,V,B
Public Sub Decompose(Couleur, R, v, b)
R = Int(Couleur Mod 256)
v = Int((Couleur - R) / 256 Mod 256)
b = Int((Couleur - R) / 256 / 256)
Verif R, v, b
End Sub
'procédure qui verifi les limites des composantes de la couleur rvb
Public Sub Verif(R, v, b)
If R < 0 Then R = 0
If v < 0 Then v = 0
If b < 0 Then b = 0
If R > 255 Then R = 255
If v > 255 Then v = 255
If b > 255 Then b = 255
End Sub