Pick color from a picture

2 posts, 0 answers
  1. Henry
    Henry avatar
    35 posts
    Member since:
    Mar 2009

    Posted 23 Feb 2012 Link to this post

    Hi, is it possible to pick a color from a picture, instead from a palette. Or pick a color from anywhere in the browser. Thanks, Henry
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 27 Feb 2012 Link to this post

    Henry:

    In the current release of RadColorPicker,  you can get and set the current color of a RadColorPicker programmatically only through a System.Drawing.Color type.

    But, it is also possible to convert a hex color code to and from a System.Drawing.Color through the static methods FromHtml and ToHtml of the System.Drawing.ColorTranslator class.

    There is no functionality in RadColorPicker to get the hex value of the selected pixel of an image or in the screen display. It seems that this could be possible using JavaScript. See the JavaScript eyedropper (tell color of Pixel under mouse cursor).

    If you could do this with JavaScript, you'd then be able to use the value to set the "SelectedColor" by passing it to this method:

    RadColorPicker1.SelectedColor = ColorTranslator.FromHtml(hexValue);

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top