Monday, May 20, 2024
23
rated 0 times [  25] [ 2]  / answers: 1 / hits: 25622  / 11 Years ago, sat, march 23, 2013, 12:00:00

The application lets user save the designs and post it so other users can view it later.



The original canvas saved with the proportions of width=700 and height=600. But when displaying the canvas, I want to resize the canvas to fit into dimensions of (350,300). half of the original. But if I directly apply those dimensions and load width setWidth() and setHeight() it loads with original proportions.



All I want is to display the canvas with new dimensions.


More From » html5-canvas

 Answers
12

Previously answered here.



I'm not sure what you've been trying, but



var canvas = document.getElementsByTagName('canvas')[0];
canvas.width = 800;
canvas.height = 600;


should work fine.


[#79411] Thursday, March 21, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
ryanulyssesb questions
Sat, Mar 20, 21, 00:00, 3 Years ago
Mon, Sep 14, 20, 00:00, 4 Years ago
Mon, Mar 9, 20, 00:00, 4 Years ago
Sun, Jul 7, 19, 00:00, 5 Years ago
;