示例#1
0
        private static void Test1024x768Write()
        {
            var buffer = Enumerable.Repeat(0, width * height).Select(i => rnd.Next(0, 255)).ToArray();
            var time   = DateTime.UtcNow.ToString("s", System.Globalization.CultureInfo.InvariantCulture).Replace(":", "-");

            CreateDirectoryIfNotExists("./data");
            ImageWriter.Write(ref buffer, $"./data/Test1024x768Write-{time}.png", width, height);
        }
示例#2
0
 internal void Run(float deltaTime, int timeSteps)
 {
     for (int i = 0; i < timeSteps; i++)
     {
         Step(deltaTime, i);
         frameBuffer.Update(ref particles.positionX, ref particles.positionY);
         ImageWriter.FastWrite(frameBuffer.GetFrameBuffer(), $"{DataDirectory}/Simulation-{i}.png", frameBuffer.width, frameBuffer.height);
         Console.WriteLine($"[{DateTime.Now.ToLocalTime()}] [{i}/{timeSteps}]");
     }
     Console.WriteLine($"Done");
 }
示例#3
0
 internal void Write(string fileName)
 {
     ImageWriter.FastWrite(ref frame, fileName, width, height);
     frame = new Image <Rgba32>(width, height);
 }