public MainWindow() { InitializeComponent(); CompositionTarget.Rendering += CompositionTarget_Rendering; bmp = new WriteableBitmap(800, 600, 96, 96, PixelFormats.Bgra32, null); tracer = new RayTracer(); this.Background = new ImageBrush() { ImageSource = bmp }; }
public Form1() { InitializeComponent(); Width = 720; Height = 480; var rayTracer = new RayTracer(box); KeyDown += rayTracer.KeyDown; rayTracer.Run(); }