Example #1
0
 /// <summary>
 /// Resizes
 /// </summary>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 public void Resize(double width, double height)
 {
     if (ActualWidth == width && ActualHeight == height)
     {
         return;
     }
     ActualWidth  = width;
     ActualHeight = height;
     Log(LogLevel.Information, $"Width = {width}; Height = {height};");
     if (IsInitialized)
     {
         StopRendering();
         var texture = renderBuffer.Resize((int)ActualWidth, (int)ActualHeight);
         OnNewRenderTargetTexture?.Invoke(this, new Texture2DArgs(texture));
         if (Viewport != null)
         {
             var overlay = Viewport.D2DRenderables.FirstOrDefault();
             if (overlay != null)
             {
                 overlay.InvalidateAll();
             }
         }
         StartRendering();
     }
 }