Skip to main content

10 posts tagged with "Visualization"

View all tags

Intro to Canvas

· 9 min read
Kimi Gao
Fullstack & AI

画布尺寸

高清分辨率

上面说过,避免图形变形失真,要保持画布尺寸和画板尺寸一致。

这只是针对分辨率不高的设备而言,其 window.devicePixelRatio 为 1。而高分辨率屏幕,它的 window.devicePixelRatio 大于 1。

Canvas 绘制的图形是位图,即 栅格图像点阵图像,当将它渲染到高清屏时,会被放大,每个像素点会用 window.devicePixelRatio 平方个物理像素点来渲染,因此图片会变得模糊。

Bezier Curves

· 8 min read
Kimi Gao
Fullstack & AI

The path element features quite a number of these commands. There are two that are relevant for our purposes:

  • Q, which instructs the path to create a quadratic Bézier curve.
  • C, which instructs the path to create a cubic Bézier curve.

Online practice site: https://bezier.method.ac