AnalysisImageClick.OCRTools.detectFirstRedLine C# (CSharp) Method

detectFirstRedLine() private static method

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