vb.net - implementing a trackbar that will change background color of form -


I want to have a trackbar on my form which will correspond to the background color of the hie, ranges from 1 to 360, And another trackbar that corresponds to the background color saturation within the range of 1 to 50. By using the

HSVTOGGB Both TrackBar can control the same event handler and use this code:

  Personal subtbHUE_Scroll (ByVal Sender as System.Object, ByVal e System.EventArgs as tbHUE.Scroll, tbSaturation.Scroll dim R, G, handle b as integer HSVtoRGB (R, g, b, tbHUE.Value, tbSaturation.Value / 50, 255) BackColor = Color.FromArgb (R, G, B) End Sub  

EDIT: Here are the right Following the best practices since the process is not really in the link:

  Private Sub HSVTO RGB (Integer such as Bay Ref Red, By Reef Green, by the referee Blue Integer As, byVal Hugh Double, ByVal as Shani Double, ByVal value in the form of integer) I dim as the integer dim, double as double, double as double, double as T Q as the form If the force = 0 then red = value green = value blue = value exhaust sub end if i = cint (hue) \ 60 hue = hue / 60f = hue - ip = value * (1 - sat) q = value * ( 1 - sat * f) T = value * (1 - Saturn * (1 - f)) Case selection: Episode 0 red = value green = CInt (t) blue = CInt (P) case 1 red = CInt (Q) Green = Price Blue = CInt (P) Case 2 Red = CInt (P) Green = Value Blue = CInt (T) Case 3 Red = CInt (P) Green = CInt (Q) Blue = Value Case 4 Red = CInt (T ) Green = CInt (P) Blue = Original If Episode 5 Red = Green value = Siaianti (P) Blue = Siaianti (Q) and stitched and end  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -