當前位置: 首頁>>代碼示例>>C#>>正文


C# NikseBitmap.GetPixelColors方法代碼示例

本文整理匯總了C#中Nikse.SubtitleEdit.Logic.NikseBitmap.GetPixelColors方法的典型用法代碼示例。如果您正苦於以下問題:C# NikseBitmap.GetPixelColors方法的具體用法?C# NikseBitmap.GetPixelColors怎麽用?C# NikseBitmap.GetPixelColors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nikse.SubtitleEdit.Logic.NikseBitmap的用法示例。


在下文中一共展示了NikseBitmap.GetPixelColors方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: IsVerticalLineTransparent

 private static bool IsVerticalLineTransparent(NikseBitmap bmp, ref int y, int x)
 {
     for (y = 0; y < bmp.Height - 1; y++)
     {
         var argb = bmp.GetPixelColors(x, y);
         if (argb[0] < 10 || IsColorClose(argb[0], argb[1], argb[2], argb[3], Color.Black, 280)) // still dark color...
         {
         }
         else
         {
             return false;
         }
     }
     return true;
 }
開發者ID:radinamatic,項目名稱:subtitleedit,代碼行數:15,代碼來源:NikseBitmapImageSplitter.cs

示例2: RemoveBlackBarRight

 private static void RemoveBlackBarRight(NikseBitmap bmp)
 {
     int xRemoveBlackBar = bmp.Width - 1;
     for (int yRemoveBlackBar = 0; yRemoveBlackBar < bmp.Height; yRemoveBlackBar++)
     {
         byte[] c = bmp.GetPixelColors(xRemoveBlackBar, yRemoveBlackBar);
         if (c[0] == 0 || IsColorClose(c[0], c[1], c[2], c[3], Color.Black, 280))
         {
             if (bmp.GetAlpha(xRemoveBlackBar - 1, yRemoveBlackBar) == 0)
                 bmp.SetPixel(xRemoveBlackBar, yRemoveBlackBar, Color.Transparent);
         }
     }
 }
開發者ID:radinamatic,項目名稱:subtitleedit,代碼行數:13,代碼來源:NikseBitmapImageSplitter.cs

示例3: IsCursiveVerticalLineTransparent

        private static bool IsCursiveVerticalLineTransparent(NikseBitmap bmp, int size, int y, int x, List<Point> cursivePoints)
        {
            bool cursiveOk = true;
            int newY = y;
            int newX = x;
            while (cursiveOk && newY < bmp.Height - 1)
            {
                Color c0 = bmp.GetPixel(newX, newY);
                if (c0.A == 0 || IsColorClose(c0, Color.Black, 280))
                {
                    newY++;
                }
                else
                {
                    byte[] c1 = bmp.GetPixelColors(newX - 1, newY - 1);
                    byte[] c2 = bmp.GetPixelColors(newX - 1, newY);
                    if ((c1[0] == 0 || IsColorClose(c1[0], c1[1], c1[2], c1[3], Color.Black, 280)) && // still dark color...
                        (c2[0] == 0 || IsColorClose(c2[0], c2[1], c2[2], c2[3], Color.Black, 280)))
                    {
                        cursivePoints.Add(new Point(newX, newY));
                        if (newX > 1)
                            newX--;
                        else
                            cursiveOk = false;

                        newY++;
                    }
                    else
                    {
                        cursiveOk = false;
                    }
                }

                if (newX < x - size)
                    cursiveOk = false;
            }
            return cursiveOk;
        }
開發者ID:radinamatic,項目名稱:subtitleedit,代碼行數:38,代碼來源:NikseBitmapImageSplitter.cs

示例4: RemoveBlackBarRight

        private static void RemoveBlackBarRight(NikseBitmap bmp)
        {
            int xRemoveBlackBar = bmp.Width - 1;
            for (int yRemoveBlackBar = 0; yRemoveBlackBar < bmp.Height; yRemoveBlackBar++)
            {
                byte[] colors = bmp.GetPixelColors(xRemoveBlackBar, yRemoveBlackBar);
                if (colors[0] != 0 && !IsColorClose(colors[0], colors[1], colors[2], colors[3], Color.Black, 280))
                {
                    continue;
                }

                if (bmp.GetAlpha(xRemoveBlackBar - 1, yRemoveBlackBar) == 0)
                {
                    bmp.SetPixel(xRemoveBlackBar, yRemoveBlackBar, Color.Transparent);
                }
            }
        }
開發者ID:AsenTahchiyski,項目名稱:SoftUni-Projects,代碼行數:17,代碼來源:NikseBitmapImageSplitter.cs


注:本文中的Nikse.SubtitleEdit.Logic.NikseBitmap.GetPixelColors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。