Canvas inline height and width attributes overridden with css styles. Is this is a bug?

后端 未结 2 554
旧巷少年郎
旧巷少年郎 2021-01-19 14:22

I recently asked a question on how to draw an image larger than my canvas onto the canvas without cropping and save the image back into its original dimensions after perform

2条回答
  •  灰色年华
    2021-01-19 15:03

    This behaviour is commonly used for controlling the size of a canvas:

    • Attributes for resolution
    • CSS for stretching/shrinking

    See Canvas width and height in HTML5.

提交回复
热议问题