本文整理汇总了C#中Bgr.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Bgr.Save方法的具体用法?C# Bgr.Save怎么用?C# Bgr.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bgr
的用法示例。
在下文中一共展示了Bgr.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
UI.OpenImage();
Bgr<byte>[,] image = new Bgr<byte>[480, 640];
Hsv<byte> color = UI.PickColor(Bgr<byte>.Red).ToHsv();
for (int s = 0; s <= Byte.MaxValue; s++)
{
color.S = (byte)s;
image.SetValue<Bgr<byte>>(color.ToBgr());
image.Show(scaleForm: true);
((double)s / Byte.MaxValue).Progress(message: "Changing saturation");
Thread.Sleep(50);
}
//save last image
string fileName = UI.SaveImage();
if (fileName != null) image.Save(fileName);
//close all
UI.CloseAll();
}
示例2: Main
static void Main(string[] args)
{
//select color
Bgr<byte>[,] image = new Bgr<byte>[480, 640];
Hsv<byte> color = UI.PickColor(Bgr<byte>.Red).ToHsv();
//select mask
Gray<byte>[,] mask = image.GetMask();
if (mask.AsEnumerable().Sum(x => x.Intensity) == 0) //if the mask is empty
mask.SetValue<Gray<byte>>(Byte.MaxValue);
//increase saturation incrementally
for (int s = 0; s <= Byte.MaxValue; s++)
{
color.S = (byte)s;
image.SetValue<Bgr<byte>>(color.ToBgr(), mask);
image.Show(scaleForm: true);
((double)s / Byte.MaxValue).Progress(message: "Changing saturation");
Thread.Sleep(50);
}
//save last image
string fileName = UI.SaveImage();
if (fileName != null) image.Save(fileName);
//close all
UI.CloseAll();
}
示例3: BasicImageOperationsDemo
public BasicImageOperationsDemo()
{
InitializeComponent();
//create a managed image
var image = new Bgr<byte>[480, 640];
//draw something
image.Draw(new Rectangle(50, 50, 200, 100), Bgr<byte>.Red, -1);
image.Draw(new Circle(50, 50, 25), Bgr<byte>.Blue, 5);
image.Draw(new Box2D(new Point(250, 150), new Size(100, 100), 30), Bgr<byte>.Green, 1);
image.Draw("Hello world!", CvFont.Big, new Point(10, 100), Bgr<byte>.White);
//save and load
image.Save("out.png");
pictureBox.Image = ImageIO.LoadColor("out.png").ToBitmap();
}