javascript - 使用弧法Javascript旋转椭圆
问题描述
使用上下文弧方法我需要在画布上旋转弧。
ctx.save();
ctx.beginPath();
ctx.translate(cx-rx, cy-ry);
ctx.scale(rx, ry);
ctx.rotate(angle * Math.PI / 180); // angle = 45 will move away from the cordinates
ctx.arc(1, 1, 1, 0, 2 * Math.PI, false);
ctx.restore();
ctx.stroke();
ctx.restore();
解决方案
推荐阅读
- c# - 对于 Fluent NHibernate 的 Oracle 和 SQL Server db,C# 中的映射语法是否不同?
- android - 防止代码重复的按钮类
- mongodb - 使用 kubernete mongo community operator 在 kubernetes 集群中运行时无法启动 mongo community db server
- r - 计算每月/每周级别的相关性
- snowflake-cloud-data-platform - 将数组传递到插入查询时的雪花语法
- r - 根据“调整后的 group_by”创建一列 - R
- json - 将多个对象合并到一个对象下,并在一个命令中添加同级对象
- google-tag-manager - 谷歌标签管理器问题 - 在“容器加载”消息之前提前触发事件
- c# - Xceed WPF Toolkit - BusyIndicator - 在 C# 中创建动态加载消息,数据模板中的数据绑定
- react-native - React Native Class Model 值变为未定义