예제 #1
0
파일: MaskData.cs 프로젝트: pvmm/Pixel3D
        public Rectangle FindExtents()
        {
            Rectangle foundRegion = Rectangle.Empty;

            for (int y = StartY; y < EndY; y++)
            {
                for (int x = StartX; x < EndX; x++)
                {
                    if (this[x, y])
                    {
                        foundRegion = RectangleExtensions.UnionIgnoreEmpty(foundRegion, new Rectangle(x, y, 1, 1)); // TODO: PERF: This is horribly inefficient
                    }
                }
            }

            return(foundRegion);
        }