ok this is the deal.. i have a code to convert an image to a certain color. what i do is get the R G B values and then add a certain value to them. (like 120 to r to create a more red image)

but this code only works correctly with grayscale images what am i doing wrong?

VB Code:
  1. Option Explicit
  2. Dim temp As Long
  3. Dim red As Integer
  4. Dim green As Integer
  5. Dim blue As Integer
  6. Dim color(2) As Integer
  7.  
  8. Private Sub Command1_Click()
  9. Dim x As Long
  10. Dim y As Long
  11. Dim temphex As String
  12. red = rvalue: green = gvalue: blue = bvalue
  13. For y = 0 To Picture1.Width - 1
  14.     For x = 0 To Picture1.Width - 1
  15.       obtainRGB (Picture1.Point(x, y))
  16.       Picture1.PSet (x, y), RGB(color(0), color(1), color(2))
  17.       DoEvents
  18.     Next x
  19. Next y
  20. End Sub
  21.  
  22.  
  23. Private Sub obtainRGB(cValue)
  24. color(0) = Int(cValue / 65536) + Int(red)
  25. cValue = cValue Mod 65536
  26. color(1) = Int(cValue / 256) + Int(green)
  27. cValue = cValue Mod 256
  28. color(2) = cValue + Int(blue)
  29. If color(0) < 0 Then color(0) = 0
  30. If color(1) < 0 Then color(1) = 0
  31. If color(2) < 0 Then color(2) = 0
  32. End Sub