@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Converts colors from RGB to hue-luminance-saturation (HLS) format. !!!!C# Signature: [System.Runtime.InteropServices.DllImport("shlwapi.dll")] static extern void ColorRGBToHLS(int RGB, ref int H, ref int L, ref int S); !!!!VB.Net Signature: <System.Runtime.InteropServices.DllImport("shlwapi.dll", EntryPoint:="ColorRGBToHLSW", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)> Private Shared Sub ColorRGBToHLS(RGB As Integer, ByRef H As Integer, ByRef L As Integer, ByRef S As Integer) End Sub !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: None. !!!!Tips & Tricks: Please add some! In VB .NET you can get the H, S, and B or L values from then color structure: 'B, Brightness, a.k.a L Lightness, Luminance DIM red as Color = Color.FromArbg(255,255,0,0) DIM H, S, B As Single H = red.GetHue S = red.GetSaturation B = red.GetBrightness !!!!Sample Code: using System; using System.Drawing; using System.Runtime.InteropServices; sealed class Win32 { [DllImport("shlwapi.dll")] static extern void ColorRGBToHLS(int RGB, ref int H, ref int L, ref int S); // //Convert System.Drawing.Color structure to HLS. // static public void ColorToHLS(System.Drawing.Color C,ref int H,ref int L,ref int S) { // //Use ColorTranslator.ToWin32 rather than Color.ToArgb because we need 0x00BBGGRR, //which is returned by ToWin32, rather than 0x00RRGGBB, which is returned by ToArgb. // ColorRGBToHLS(ColorTranslator.ToWin32(C), ref H, ref L, ref S); } } Documentation: ColorRGBToHLS@msdn on MSDN
Edit shlwapi.ColorRGBT...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.