如何從底部中心角度用 canvas HTML5 元素旋轉影像?
將影像尺寸轉換為 32,120 −
context.translate(32, 120);
現在旋轉 canvas −
context.rotate(90 * Math.PI/180);
現在繪製圖像 −
context.drawImage(img, -32, -120, 64, 120);
廣告
將影像尺寸轉換為 32,120 −
context.translate(32, 120);
現在旋轉 canvas −
context.rotate(90 * Math.PI/180);
現在繪製圖像 −
context.drawImage(img, -32, -120, 64, 120);