本文整理汇总了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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}