Hi Christian and thanks
Then you need to decide, do you scale all your values, so if you have a value of 2.0, any 1.0 becomes .5 so they stay in proportion
Yes, all values need to be in proportion. I think this part is easy as I know minimum and maximum values (0-255).
Does this work ? In C# you need to divide by a float ( 255.0 ) to get a float value.
Hum that was just a "pseudo code", but today I tried this in a simple project and it seems to work fine.
Dim Rdbl As Double = inptR.Value / 255.0 'NumericUpDown controls
Dim Gdbl As Double = inptG.Value / 255.0
Dim Bdbl As Double = inptB.Value / 255.0
lblR.Text = "R: " & Rdbl.ToString 'debug labels
lblG.Text = "G: " & Gdbl.ToString
lblB.Text = "B: " & Bdbl.ToString
Dim Rint As Integer = CInt(Rdbl * 255)
Dim Gint As Integer = CInt(Gdbl * 255)
Dim Bint As Integer = CInt(Bdbl * 255)
lblRint.Text = "R: " & Rint 'debug labels
lblGint.Text = "G: " & Gint
lblBint.Text = "B: " & Bint
The results seems to be always good. When I have "1" in Double ,integer conversion is 255, that's ok.
But I don't understand why, when I enter 128 in Integer, the result in Double is 0.501960784313725 :confused:
Why it's not 0.5000000..... ??
I don't know if that will be a problem for my interpolation calculations :doh:
Maybe there is a better way to do this ?