Пример #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();
     }
 }
Пример #2
0
 private void RenderBuffer_OnNewBufferCreated(object sender, Texture2DArgs e)
 {
     OnNewRenderTargetTexture?.Invoke(this, e);
 }