【问题标题】:How to equal Microsoft.Matrix filter to canvas rotate? [closed]如何将 Microsoft.Matrix 过滤器等同于画布旋转? [关闭]
【发布时间】:2010-09-26 20:43:23
【问题描述】:

有没有人可以帮助使用这个通用的旋转功能(它适用于 jQuery,但这是一个 JavaScript 的东西)?

我更改了非 IE 画布代码,使其围绕图像的中心旋转(请参阅 Firefox 中的 http://uptowar.com/jquery)。现在我需要更改 IE Microsoft 过滤器以执行相同的操作(请参阅 Internet Explorer 中的相同 URL)。但是,怎么做?该过滤器几乎没有可理解的文档。

【问题讨论】:

    标签: javascript image html canvas rotation


    【解决方案1】:

    假设您有一个以弧度为单位的角度 nAngle,那么旋转矩阵将如下所示:

    var nCos = Math.cos(nAngle).toFixed(3), nSin = Math.sin(nAngle).toFixed(3); var sFilter = "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=" + nCos + ", M12=" + (-nSin) + ", M21=" + nSin + ", M22=" + nCos + ")";

    您可能还想查看规范:Matrix Filter

    【讨论】:

      猜你喜欢
      • 2013-04-05
      • 1970-01-01
      • 2012-06-01
      • 2020-07-09
      • 2020-08-13
      • 2022-10-23
      • 2014-02-01
      • 1970-01-01
      • 2018-04-09
      相关资源
      最近更新 更多