Esshahn
Esshahn

Reputation: 430

How to double the pixel size of a canvas?

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?

Upvotes: 2

Views: 3387

Answers (1)

Brugnar
Brugnar

Reputation: 227

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>

Upvotes: 7

Related Questions