Oleg's profileOleg V. Polikarpotchkin ...BlogNetwork Tools Help

Blog


    June 10

    LuminositySlider Control

    This element is one more control from the ColorPicker constituent controls bug in addition to the published in my recent posts.

    LuminositySlider control is designed as the selector of the Color with the HSL Color model Luminosity ranging from 0 to 1. It's the extension of the Slider control.

    LuminositySlider is provided with the reference Color through the BaseColor Dependency Property. It displays that reference Color gradient starting from the reference Color with the Luminosity set to 0 up to the Color with the Luminosity of 1.

    That is the sample:

    LuminositySlider

    At the top is the RainbowSlider allowing to select the BaseColor for two LuminositySliders (horizontal and vertical) below it.

    LuminositySlider has read-only SelectedColor Dependency Property used to get the value of the Color selected. This property value is synchronized with Minimum, Maximum and Value properties values of the parent Slider control. The caller can set the desired luminance value from the code as follows:

    Value = Luminance * (Maximum - Minimum) + Minimum;

    When the SelectedColor changes the LuminositySlider raises the SelectedColorChanged event.

    The direction the Luminosity value changes depends on the value of IsDirectionReversed property. If it's false (the default) the minimum Luminosity is at the left or at the bottom of the control depending on the orientation.

    The code

    You can download the code and the samples here:


    The archive contains my WPFGears library with samples, tests, etc. It’s the Visual Studio 2008 SP1 solution targeted to .NET Framework 3.5.

    You’ll find LuminositySliderSample project there. LuminositySlider element code is in the WPFGears library project ColorPickerControls folder.

    Regards,
    Oleg V. Polikarpotchkin

    Technorati Теги: ,,,

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://ov-p.spaces.live.com/blog/cns!39D56F0C7A08D703!303.trak
    Weblogs that reference this entry
    • None