如何從底部中心角度用 HTML5 canvas 元素旋轉影像?


將影像尺寸設為 32, 120 −

context.translate(32, 120);

現在旋轉畫布 −

context.rotate(90 * Math.PI/180);

現在繪製圖像 −

context.drawImage(img, -32, -120, 64, 120);

修改於: 2020-06-25

238 檢視

開啟你的 職業生涯

透過完成課程獲得認證

開始吧
廣告
© . All rights reserved.