javascript - How to double the pixel size of a canvas? - Stack Overflow

I have a canvas of the size 320*200 pixels.Now I want to double the size of the pixels, resulting in a

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>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745230643a4617662.html

相关推荐

  • javascript - How to double the pixel size of a canvas? - Stack Overflow

    I have a canvas of the size 320*200 pixels.Now I want to double the size of the pixels, resulting in a

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信