【问题标题】:SharpDX DirectWrite rotate textSharpDX DirectWrite 旋转文本
【发布时间】:2015-04-11 23:16:04
【问题描述】:

我想知道如何使用 SharpDX 旋转使用 Direct2D 呈现的文本。

在

中找不到任何可能

RenderTarget2D.DrawText()

或

RenderTarget2D.DrawTextLayout()

【问题讨论】:

    标签: c# rotation direct2d sharpdx directwrite


    【解决方案1】:

    您可以使用 Transformation Matrix,更准确地说 - 通过 3x2 矩阵使用 rotation transformation。

    伪例子:

    RenderTarget2D.BeginDraw;
    try
      // your regular drawings
      ....
    
      // save the current tranform
      currentTransform = RenderTarget2D.GetTransform;
    
      // set a 90 degree rotation around the (100,100);
      RenderTarget2D.SetTransform(Matrix3x2F.Rotation(90, Point2F(100,100))); 
    
      // do your rotated text drawings
      RenderTarget2D.DrawText();
    
      // restore your previous/original transform
      RenderTarget2D.SetTransform(currentTransform);
    finally
      RenderTarget2D.EndDraw;
    end;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-04
      • 2012-06-13
      • 2014-03-20
      • 2015-03-30
      • 1970-01-01
      • 2013-08-16
      相关资源
      最近更新 更多