Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个大小为 320*200 像素的画布。现在我想将像素大小加倍,得到 640*400 的显示。我不希望它有更高的像素分辨率,只是一切都翻了一番(更大的可见像素)。
关于如何做到这一点的任何想法?
您可以使用高度和宽度属性调整分辨率,同时通过样式调整大小的显示。
<canvas width="320" height="200" style="width:640px;height:400px;"></canvas>