.NET: Color Balance

Posted By Venu Thomas

Represents a good control horizontal scroll bar of Windows standard, this screen will see how to change the colors to a panel control by controlling HScrollBar.

colorbalance

Public Class Form1_WiseCodes

 Private Sub Red_HScrollBar_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Red_HScrollBar.ValueChanged
 ColorPerview_Panel1.BackColor = ColorTranslator.FromOle(RGB(0 + Red_HScrollBar.Value, Green_HScrollBar.Value + 0, 0 + Blue_HScrollBar.Value))
 lblRedValue.Text = Red_HScrollBar.Value
 End Sub

 Private Sub Green_HScrollBar_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Green_HScrollBar.ValueChanged
 ColorPerview_Panel1.BackColor = ColorTranslator.FromOle(RGB(0 + Red_HScrollBar.Value, Green_HScrollBar.Value + 0, 0 + Blue_HScrollBar.Value))
 lblGreenValue.Text = Green_HScrollBar.Value
 End Sub

 Private Sub Blue_HScrollBar_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Blue_HScrollBar.ValueChanged
 ColorPerview_Panel1.BackColor = ColorTranslator.FromOle(RGB(0 + Red_HScrollBar.Value, Green_HScrollBar.Value + 0, 0 + Blue_HScrollBar.Value))
 lblBlueValue.Text = Blue_HScrollBar.Value
 End Sub

End Class

Set Values of all the HScrollBar as following . The three arguments (red, green & blue)  must each be in the range 0 to 255.

colorbalance_02

Download Source Code

Happy Programming!!

Tags: ,

  •  
  • Share with others:

    Thanks for visiting us! If you enjoyed these icons please feel free to share them! Or if you want to know what's going on with WiseCodes.com, follow us!

    Leave a Reply

    Anti-Spam Protection by WP-SpamFree

    Locations of visitors to this page eXTReMe Tracker