excubo-ag / Blazor.Canvas

Home Page:https://excubo-ag.github.io/Blazor.Canvas/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How to resize a canvas to fit the screen?

iSeiryu opened this issue · comments

commented

Is there an easy way to dynamically resize a canvas so it would scale with the window's size change?
Browsers can be opened on many different screens and sized differently too. There are 2 parts to this question:

  1. How to capture the initial window size to set the initial canvas's size?
  2. How to resize the canvas together with the window?

It sounds like you're trying to do something akin to this: https://stackoverflow.com/a/8486324/985296

Resizing the canvas element is outside of the scope of this library, as it's not part of the canvas API.

commented

Resizing the canvas element is outside of the scope of this library

I know, hence it was just a question. People that work with Blazor and canvases may run into the same need and might have a solution already that they could share.