private async void Button_Click(object sender, RoutedEventArgs e)
        {
#if __WASM__
            Uno.Foundation.WebAssemblyRuntime.InvokeJS("Uno.UI.Demo.Analytics.reportPageView('benchmark');");
#endif

            RayTraceBenchmark.Console.WriteLineCallback = print;
            BenchmarkMain.SaveImageCallback             = showImage;
            await BenchmarkMain.Start();
        }
Ejemplo n.º 2
0
        private void showImage(byte[] data)
        {
            var bitmap      = new WriteableBitmap(Benchmark.Width, Benchmark.Height);
            var pixelBuffer = bitmap.PixelBuffer;
            var stream      = pixelBuffer.AsStream();

            data = BenchmarkMain.ConvertRGBToBGRA(data);
            stream.Write(data, 0, data.Length);
            stream.Flush();
            image.Source = bitmap;
        }
Ejemplo n.º 3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     RayTraceBenchmark.Console.WriteLineCallback = print;
     BenchmarkMain.SaveImageCallback             = showImage;
     BenchmarkMain.Start();
 }