SharpDX DirectWrite 旋转文本

SharpDX DirectWrite rotate text

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

中找不到任何可能性

RenderTarget2D.DrawText()

RenderTarget2D.DrawText布局()

您可以通过 3x2 矩阵使用 Transformation Matrix and more precisely - a 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;