# FillPloygon **Repository Path**: Chenyliang/fill-ploygon ## Basic Information - **Project Name**: FillPloygon - **Description**: 使用FillPloygon算法手动分割图像,采用洪泛法 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-18 - **Last Updated**: 2022-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: dotNET, Algorithm, API ## README ```csharp // begin Bitmap b = new Bitmap(128, 128); var corners = new Point[] { new Point(1,1), new Point(200,20), new Point(2,15)}; using (Graphics g = Graphics.FromImage(b)) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.Clear(System.Drawing.Color.Black); g.FillPolygon(System.Drawing.Brushes.White, corners); } // end byte[,] mask = new byte[b.Width, b.Height]; for (int y = 0; y < b.Height; y++) for (int x = 0; x < b.Width; x++) { mask[x, y] = b.GetPixel(x, y).R > 0 ? (byte)1 : (byte)0; } Console.WriteLine(mask[16,17]); ``` 分割图像 System.Grahpics.FillPloygon();