Exemplo n.º 1
0
        private static int?GetBottomEdgeOfRegionOfInterest(FlattenedBitmap flattenedBitmap)
        {
            for (int i = flattenedBitmap.Height - 1; i >= 0; --i)
            {
                for (int j = flattenedBitmap.Stride - 1; j >= 0; --j)
                {
                    if (flattenedBitmap.Data[i, j] < 255)
                    {
                        return(i == flattenedBitmap.Height - 1 ? i : i + 1);
                    }
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        private static int?GetTopEdgeOfRegionOfInterest(FlattenedBitmap flattenedBitmap)
        {
            for (int i = 0; i < flattenedBitmap.Height - 1; ++i)
            {
                for (int j = 0; j < flattenedBitmap.Stride - 1; ++j)
                {
                    if (flattenedBitmap.Data[i, j] < 255)
                    {
                        return(i == 0 ? 0 : i - 1);
                    }
                }
            }

            return(null);
        }