AnalysisImageClick.OCRTools.detectSecondRedLine C# (CSharp) Method

detectSecondRedLine() private static method

private static detectSecondRedLine ( Bitmap bmp ) : int
bmp System.Drawing.Bitmap
return int
        private static int detectSecondRedLine(Bitmap bmp)
        {
            int redX = -1;
            try
            {
                for (int w = 0; w < bmp.Width; w++) {
                    for (int h = 0; h < bmp.Height; h++){
                        Color c = bmp.GetPixel(w, h);
                        if (c.R == 255 && h == 0){
                            bool isRedLine = true;
                            for (int hTest = h; hTest < bmp.Height; hTest++){
                                c = bmp.GetPixel(w, hTest);
                                if (c.R != 255)
                                {
                                    isRedLine = false;
                                    break;
                                }
                            }
                            if (isRedLine)
                            {
                                redX = w;
                                return redX;
                            }
                        }
                    }
                }
            }
            catch (Exception e) { }
            return redX;
        }