admin管理员组

文章数量:1415467

I have a canvas of the size 320*200 pixels. Now I want to double the size of the pixels, resulting in a 640*400 display. I don't want it to have a higher pixel resolution, just everything doubled (bigger visible pixels).

Any idea on how to do that?

I have a canvas of the size 320*200 pixels. Now I want to double the size of the pixels, resulting in a 640*400 display. I don't want it to have a higher pixel resolution, just everything doubled (bigger visible pixels).

Any idea on how to do that?

Share Improve this question asked Apr 15, 2013 at 14:23 EsshahnEsshahn 4405 silver badges17 bronze badges 2
  • It may be better to explain why a question should be down-voted. This is a legit question. Probably down-voted because its been asked before. But still its not poorly asked. – Brenwell Commented Nov 23, 2015 at 10:56
  • Thank you for explaining that Brenwell, I was a bit puzzled about this as well. I'll make sure to double check for any question already asked before. – Esshahn Commented Nov 23, 2015 at 10:59
Add a ment  | 

1 Answer 1

Reset to default 7

You can adjust the resolution with the height and width properties, while adjusting the size's display trough the style.

<canvas width="320" height="200" style="width:640px;height:400px;"></canvas>

本文标签: javascriptHow to double the pixel size of a canvasStack Overflow