本文整理汇总了C#中PixelBuffer.SaveToFile方法的典型用法代码示例。如果您正苦于以下问题:C# PixelBuffer.SaveToFile方法的具体用法?C# PixelBuffer.SaveToFile怎么用?C# PixelBuffer.SaveToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PixelBuffer
的用法示例。
在下文中一共展示了PixelBuffer.SaveToFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
/// <summary>
/// Entry point - pass "verbose" as a command-line
/// argument to initialize Embree in verbose mode.
/// </summary>
public static int Main(String[] args)
{
try
{
var verbose = (args.Length == 1 && args[0].ToLower() == "verbose");
if (verbose)
{
Console.WriteLine("Embree.NET Sample [VERBOSE]");
Console.WriteLine("===========================");
RTC.Register("verbose=999"); // max verbosity?
}
else
{
Console.WriteLine("Embree.NET Sample");
Console.WriteLine("=================");
}
Console.WriteLine(""); // this is for debugging
Console.WriteLine("[+] " + Bits + "-bit mode.");
Console.WriteLine("[+] Building a test scene.");
using (var renderer = new Renderer())
{
var pixBuf = new PixelBuffer(1920, 1080);
Console.WriteLine("[+] Now rendering.");
renderer.Render(pixBuf); // benchmark?
Console.WriteLine("[+] Saving image to 'render.png'.");
pixBuf.SaveToFile("render.png"); // save to png format
}
if (verbose)
RTC.Unregister();
return EXIT_SUCCESS;
}
catch (Exception e)
{
var msg = e is AggregateException ? e.InnerException.Message : e.Message;
Console.WriteLine(String.Format("[!] Error: {0}.", msg));
Console.WriteLine("\n========= STACK TRACE =========\n");
Console.WriteLine(e.StackTrace);
return EXIT_FAILURE;
}
}