#region 返回图片指定点的RGB值 /// <summary> /// 返回图片指定点的RGB值 /// </summary> /// <param name="ImageName"></param> /// <returns></returns> public static string GetImageRGB(string ImageName) { string temp = string.Empty; if (File.Exists(ImageName)) { Bitmap bmp = new Bitmap(ImageName); Color pixelColor = bmp.GetPixel(50, 50); int rgb = pixelColor.ToArgb() & 0xFFFFFF; temp = "#" + rgb.ToString("X6"); } else { temp = "#FBAA1A"; } return temp; } #endregion