本文整理汇总了C#中FastBitmap.UnlockImage方法的典型用法代码示例。如果您正苦于以下问题:C# FastBitmap.UnlockImage方法的具体用法?C# FastBitmap.UnlockImage怎么用?C# FastBitmap.UnlockImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FastBitmap
的用法示例。
在下文中一共展示了FastBitmap.UnlockImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSubtitleBitmap
//.........这里部分代码省略.........
}
b = merged;
}
else if (bitmaps.Count == 1)
{
b = bitmaps[0];
}
if (b != null)
{
if (_isSon && checkBoxCustomFourColors.Checked)
{
GetCustomColors(out background, out pattern, out emphasis1, out emphasis2);
FastBitmap fbmp = new FastBitmap(b);
fbmp.LockImage();
for (int x = 0; x < fbmp.Width; x++)
{
for (int y = 0; y < fbmp.Height; y++)
{
Color c = fbmp.GetPixel(x, y);
if (c.R == Color.Red.R && c.G == Color.Red.G && c.B == Color.Red.B) // normally anti-alias
fbmp.SetPixel(x, y, emphasis2);
else if (c.R == Color.Blue.R && c.G == Color.Blue.G && c.B == Color.Blue.B) // normally text?
fbmp.SetPixel(x, y, pattern);
else if (c.R == Color.White.R && c.G == Color.White.G && c.B == Color.White.B) // normally background
fbmp.SetPixel(x, y, background);
else if (c.R == Color.Black.R && c.G == Color.Black.G && c.B == Color.Black.B) // outline/border
fbmp.SetPixel(x, y, emphasis1);
else
fbmp.SetPixel(x, y, c);
}
}
fbmp.UnlockImage();
}
if (checkBoxAutoTransparentBackground.Checked)
b.MakeTransparent();
returnBmp = b;
}
}
}
else if (_xSubList != null)
{
if (index >= 0 && index < _xSubList.Count)
{
if (checkBoxCustomFourColors.Checked)
{
GetCustomColors(out background, out pattern, out emphasis1, out emphasis2);
returnBmp = _xSubList[index].GetImage(background, pattern, emphasis1, emphasis2);
}
else
{
returnBmp = _xSubList[index].GetImage();
}
}
}
else if (_dvbSubtitles != null)
{
if (index >= 0 && index < _dvbSubtitles.Count)
{
var dvbBmp = _dvbSubtitles[index].GetActiveImage();
var nDvbBmp = new NikseBitmap(dvbBmp);
nDvbBmp.CropTopTransparent(2);
nDvbBmp.CropTransparentSidesAndBottom(2, true);
if (checkBoxTransportStreamGetColorAndSplit.Checked)
_dvbSubColor = nDvbBmp.GetBrightestColorWhiteIsTransparent();